Sha256: f04da9a2dccceaee13844c95fe5952df03163132cfcf88150e9a33bbd381c051

Contents?: true

Size: 1.23 KB

Versions: 4

Compression:

Stored size: 1.23 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                        :integer          not null, primary key
#  name                      :string           not null
#  display_name              :text
#  note                      :text
#  position                  :integer
#  created_at                :datetime
#  updated_at                :datetime
#  display_name_translations :jsonb            not null
#

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
enju_circulation-0.4.0.beta.4 app/models/checkout_type.rb
enju_circulation-0.4.0.beta.3 app/models/checkout_type.rb
enju_circulation-0.4.0.beta.2 app/models/checkout_type.rb
enju_circulation-0.4.0.beta.1 app/models/checkout_type.rb