Sha256: 4a9d5f91983a5635f6689d436d0614a745e3e8ef24bd306538822fbe9332e2d0

Contents?: true

Size: 1.26 KB

Versions: 1

Compression:

Stored size: 1.26 KB

Contents

class CheckoutType < ApplicationRecord
  include MasterModel
  scope :available_for_carrier_type, lambda {|carrier_type| includes(:carrier_types).where('carrier_types.name = ?', carrier_type.name).order('carrier_types.position')}
  scope :available_for_user_group, lambda {|user_group| includes(:user_groups).where('user_groups.name = ?', user_group.name).order('user_group.position')}

  has_many :user_group_has_checkout_types, dependent: :destroy
  has_many :user_groups, through: :user_group_has_checkout_types
  has_many :carrier_type_has_checkout_types, dependent: :destroy
  has_many :carrier_types, through: :carrier_type_has_checkout_types
  # has_many :item_has_checkout_types, dependent: :destroy
  # has_many :items, through: :item_has_checkout_types
  has_many :items

  paginates_per 10
  translates :display_name
end

# == Schema Information
#
# Table name: checkout_types
#
#  id                        :bigint           not null, primary key
#  name                      :string           not null
#  display_name              :text
#  note                      :text
#  position                  :integer
#  created_at                :datetime         not null
#  updated_at                :datetime         not null
#  display_name_translations :jsonb            not null
#

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
enju_circulation-0.4.0.rc.1 app/models/checkout_type.rb