Sha256: a6b0866b0dcba524e37cd6c36ca9d6bd4591bd4183ec5e40b4747959f9d7b6c8

Contents?: true

Size: 1.01 KB

Versions: 40

Compression:

Stored size: 1.01 KB

Contents

class CarrierTypeHasCheckoutType < ActiveRecord::Base
  scope :available_for_carrier_type, lambda {|carrier_type| {:include => :carrier_type, :conditions => ['carrier_types.name = ?', carrier_type.name]}}
  scope :available_for_user_group, lambda {|user_group| {:include => {:checkout_type => :user_groups}, :conditions => ['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

40 entries across 40 versions & 1 rubygems

Version Path
enju_circulation-0.0.43 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.0.42 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.0.41 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.0.40 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.0.39 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.0.38 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.0.37 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.0.36 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.0.35 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.0.34 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.0.33 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.0.32 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.0.31 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.0.30 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.0.29 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.0.28 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.0.27 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.0.26 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.0.25 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.0.24 app/models/carrier_type_has_checkout_type.rb