Sha256: 75b080b5e9803141bbfe6aadcdd98549184ef3149767c45ad1d0439a2720fcc6

Contents?: true

Size: 987 Bytes

Versions: 21

Compression:

Stored size: 987 Bytes

Contents

class CarrierTypeHasCheckoutType < ActiveRecord::Base
  scope :available_for_carrier_type, lambda {|carrier_type| includes(:carrier_type).where('carrier_types.name = ?', carrier_type.name)}
  scope :available_for_user_group, lambda {|user_group| includes(checkout_type: :user_groups).where('user_groups.name = ?', user_group.name)}

  belongs_to :carrier_type, validate: true
  belongs_to :checkout_type, validate: true

  validates_presence_of :carrier_type, :checkout_type
  validates_associated :carrier_type, :checkout_type
  validates_uniqueness_of :checkout_type_id, scope: :carrier_type_id

  acts_as_list scope: :carrier_type_id
end

# == Schema Information
#
# Table name: carrier_type_has_checkout_types
#
#  id               :integer          not null, primary key
#  carrier_type_id  :integer          not null
#  checkout_type_id :integer          not null
#  note             :text
#  position         :integer
#  created_at       :datetime
#  updated_at       :datetime
#

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
enju_circulation-0.2.5 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.2.4 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.2.3 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.2.2 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.2.1 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.2.0 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.2.0.beta.4 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.2.0.beta.3 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.2.0.beta.2 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.2.0.beta.1 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.1.2 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.1.1 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.1.0 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.1.0.pre49 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.1.0.pre48 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.1.0.pre47 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.1.0.pre46 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.1.0.pre45 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.1.0.pre44 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.1.0.pre43 app/models/carrier_type_has_checkout_type.rb