Sha256: 08adccb58a4edd7cdea1e60a7ffb4e59b7ab53828ec79b0e32b40c6f20192019

Contents?: true

Size: 1.07 KB

Versions: 34

Compression:

Stored size: 1.07 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
#  updated_at       :datetime
#

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
enju_circulation-0.1.0.pre7 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.1.0.pre6 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.1.0.pre5 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.1.0.pre4 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.1.0.pre3 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.1.0.pre2 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.1.0.pre app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.0.71 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.0.70 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.0.69 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.0.68 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.0.67 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.0.66 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.0.65 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.0.64 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.0.63 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.0.62 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.0.61 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.0.60 app/models/carrier_type_has_checkout_type.rb
enju_circulation-0.0.59 app/models/carrier_type_has_checkout_type.rb