Sha256: bcdae47372b83d5940540344c4dc65655cce7d6148eb3c85f59282dfe559e5d2

Contents?: true

Size: 979 Bytes

Versions: 1

Compression:

Stored size: 979 Bytes

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           :integer          default(0), not null
#  note           :text
#  position       :integer
#  created_at     :datetime
#  updated_at     :datetime
#

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
enju_circulation-0.1.0.pre41 app/models/lending_policy.rb