Sha256: 2536fecd7e5abe86c2da78a624ecfe8027b6fa54d1ebd98b532110efb551cc01

Contents?: true

Size: 1.06 KB

Versions: 8

Compression:

Stored size: 1.06 KB

Contents

class CheckoutType < ActiveRecord::Base
  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
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
#

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
enju_circulation-0.2.5 app/models/checkout_type.rb
enju_circulation-0.2.4 app/models/checkout_type.rb
enju_circulation-0.2.3 app/models/checkout_type.rb
enju_circulation-0.2.2 app/models/checkout_type.rb
enju_circulation-0.2.1 app/models/checkout_type.rb
enju_circulation-0.2.0 app/models/checkout_type.rb
enju_circulation-0.2.0.beta.4 app/models/checkout_type.rb
enju_circulation-0.2.0.beta.3 app/models/checkout_type.rb