Sha256: 2d3ed4d0dd3dda5dfe43d01f3072326bd929eb09bfb7e9f70296ef82e244c012

Contents?: true

Size: 868 Bytes

Versions: 40

Compression:

Stored size: 868 Bytes

Contents

class LendingPolicy < ActiveRecord::Base
  default_scope :order => '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

  def self.per_page
    10
  end

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

Version data entries

40 entries across 40 versions & 1 rubygems

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