Sha256: d4dcdff8b3c68e9651cbe81a8b62195b39bcc172031e02489d410ffb2f8ad970

Contents?: true

Size: 872 Bytes

Versions: 6

Compression:

Stored size: 872 Bytes

Contents

class LendingPolicy < ActiveRecord::Base
  default_scope { order('lending_policies.position') }
  belongs_to :item
  belongs_to :user_group

  validates :item, :user_group, presence: true
  validates :user_group_id, uniqueness: { 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           :integer          default(0), not null
#  note           :text
#  position       :integer
#  created_at     :datetime
#  updated_at     :datetime
#

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
enju_circulation-0.3.3 app/models/lending_policy.rb
enju_circulation-0.3.2 app/models/lending_policy.rb
enju_circulation-0.3.1 app/models/lending_policy.rb
enju_circulation-0.3.0 app/models/lending_policy.rb
enju_circulation-0.3.0.rc.1 app/models/lending_policy.rb
enju_circulation-0.3.0.beta.1 app/models/lending_policy.rb