# == Schema Information # # Table name: payment_methods # # id :integer not null, primary key # name :string(40) not null # description :string(255) not null # default :boolean default(FALSE), not null # active :boolean default(FALSE), not null # created_at :datetime # created_by :integer # updated_at :datetime # updated_by :integer # # metody platnosci class PaymentMethod < ApplicationRecord has_many :orders scope :by_default, -> { where(default: true) } scope :available, -> { where(active: true) } scope :by_name_asc, -> { order('name ASC') } end