Sha256: 1453d0c175e4d88fe659165098a7b2a1a855093b6d2c556d62aeff679006afa1

Contents?: true

Size: 1.22 KB

Versions: 27

Compression:

Stored size: 1.22 KB

Contents

class CheckoutType < ActiveRecord::Base
  attr_accessible :name, :display_name, :note
  include MasterModel
  default_scope :order => "checkout_types.position"
  scope :available_for_carrier_type, lambda {|carrier_type| {:include => :carrier_types, :conditions => ['carrier_types.name = ?', carrier_type.name], :order => 'carrier_types.position'}}
  scope :available_for_user_group, lambda {|user_group| {:include => :user_groups, :conditions => ['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

  def self.per_page
    10
  end
end

# == Schema Information
#
# Table name: checkout_types
#
#  id           :integer         not null, primary key
#  name         :string(255)     not null
#  display_name :text
#  note         :text
#  position     :integer
#  created_at   :datetime
#  updated_at   :datetime
#

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
enju_circulation-0.0.71 app/models/checkout_type.rb
enju_circulation-0.0.70 app/models/checkout_type.rb
enju_circulation-0.0.69 app/models/checkout_type.rb
enju_circulation-0.0.68 app/models/checkout_type.rb
enju_circulation-0.0.67 app/models/checkout_type.rb
enju_circulation-0.0.66 app/models/checkout_type.rb
enju_circulation-0.0.65 app/models/checkout_type.rb
enju_circulation-0.0.64 app/models/checkout_type.rb
enju_circulation-0.0.63 app/models/checkout_type.rb
enju_circulation-0.0.62 app/models/checkout_type.rb
enju_circulation-0.0.61 app/models/checkout_type.rb
enju_circulation-0.0.60 app/models/checkout_type.rb
enju_circulation-0.0.59 app/models/checkout_type.rb
enju_circulation-0.0.58 app/models/checkout_type.rb
enju_circulation-0.0.57 app/models/checkout_type.rb
enju_circulation-0.0.56 app/models/checkout_type.rb
enju_circulation-0.0.55 app/models/checkout_type.rb
enju_circulation-0.0.54 app/models/checkout_type.rb
enju_circulation-0.0.53 app/models/checkout_type.rb
enju_circulation-0.0.52 app/models/checkout_type.rb