Sha256: ac1757d7e7356c17ca02773ea6d2c064245fd9c8fbb602cb0d16f94f7e22cdc7

Contents?: true

Size: 1.1 KB

Versions: 29

Compression:

Stored size: 1.1 KB

Contents

class CarrierTypeHasCheckoutType < ActiveRecord::Base
  attr_accessible :carrier_type_id, :checkout_type_id, :note
  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         not null
#  updated_at       :datetime         not null
#

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
enju_circulation-0.1.0.pre36 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.1.0.pre35 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.1.0.pre34 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.1.0.pre33 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.1.0.pre32 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.1.0.pre31 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.1.0.pre30 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.1.0.pre29 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.1.0.pre28 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.1.0.pre27 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.1.0.pre26 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.1.0.pre25 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.1.0.pre24 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.1.0.pre23 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.1.0.pre22 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.1.0.pre21 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.1.0.pre20 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.1.0.pre19 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.1.0.pre18 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.1.0.pre17 app/models/carrier_type_has_checkout_type.rb