Sha256: 74e3635513694acdaf99fde4de67d3634fbc023291bd464e58542a729d84050e

Contents?: true

Size: 1 KB

Versions: 20

Compression:

Stored size: 1 KB

Contents

class LendingPolicy < ActiveRecord::Base
  attr_accessible :item_id, :user_group_id, :loan_period, :fixed_due_date,
    :renewal, :fine, :note, :position
  default_scope :order => 'lending_policies.position'
  belongs_to :item
  belongs_to :user_group

  validates_presence_of :item, :user_group
  validates_uniqueness_of :user_group_id, :scope => :item_id
  validates_date :fixed_due_date, :allow_blank => true

  paginates_per 10

  acts_as_list :scope => :item_id
end

# == Schema Information
#
# Table name: lending_policies
#
#  id             :integer          not null, primary key
#  item_id        :integer          not null
#  user_group_id  :integer          not null
#  loan_period    :integer          default(0), not null
#  fixed_due_date :datetime
#  renewal        :integer          default(0), not null
#  fine           :decimal(, )      default(0.0), not null
#  note           :text
#  position       :integer
#  created_at     :datetime         not null
#  updated_at     :datetime         not null
#

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
enju_circulation-0.1.0.pre27 app/models/lending_policy.rb
enju_circulation-0.1.0.pre26 app/models/lending_policy.rb
enju_circulation-0.1.0.pre25 app/models/lending_policy.rb
enju_circulation-0.1.0.pre24 app/models/lending_policy.rb
enju_circulation-0.1.0.pre23 app/models/lending_policy.rb
enju_circulation-0.1.0.pre22 app/models/lending_policy.rb
enju_circulation-0.1.0.pre21 app/models/lending_policy.rb
enju_circulation-0.1.0.pre20 app/models/lending_policy.rb
enju_circulation-0.1.0.pre19 app/models/lending_policy.rb
enju_circulation-0.1.0.pre18 app/models/lending_policy.rb
enju_circulation-0.1.0.pre17 app/models/lending_policy.rb
enju_circulation-0.1.0.pre16 app/models/lending_policy.rb
enju_circulation-0.1.0.pre15 app/models/lending_policy.rb
enju_circulation-0.1.0.pre14 app/models/lending_policy.rb
enju_circulation-0.1.0.pre13 app/models/lending_policy.rb
enju_circulation-0.1.0.pre12 app/models/lending_policy.rb
enju_circulation-0.1.0.pre11 app/models/lending_policy.rb
enju_circulation-0.1.0.pre10 app/models/lending_policy.rb
enju_circulation-0.1.0.pre9 app/models/lending_policy.rb
enju_circulation-0.1.0.pre8 app/models/lending_policy.rb