Sha256: ce34f56dcb68c22f7bc76e08d93f4fc773ce76c0dce743c75a5fd83f233b94dc

Contents?: true

Size: 866 Bytes

Versions: 21

Compression:

Stored size: 866 Bytes

Contents

class LendingPolicy < ActiveRecord::Base
  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

21 entries across 21 versions & 1 rubygems

Version Path
enju_circulation-0.2.5 app/models/lending_policy.rb
enju_circulation-0.2.4 app/models/lending_policy.rb
enju_circulation-0.2.3 app/models/lending_policy.rb
enju_circulation-0.2.2 app/models/lending_policy.rb
enju_circulation-0.2.1 app/models/lending_policy.rb
enju_circulation-0.2.0 app/models/lending_policy.rb
enju_circulation-0.2.0.beta.4 app/models/lending_policy.rb
enju_circulation-0.2.0.beta.3 app/models/lending_policy.rb
enju_circulation-0.2.0.beta.2 app/models/lending_policy.rb
enju_circulation-0.2.0.beta.1 app/models/lending_policy.rb
enju_circulation-0.1.2 app/models/lending_policy.rb
enju_circulation-0.1.1 app/models/lending_policy.rb
enju_circulation-0.1.0 app/models/lending_policy.rb
enju_circulation-0.1.0.pre49 app/models/lending_policy.rb
enju_circulation-0.1.0.pre48 app/models/lending_policy.rb
enju_circulation-0.1.0.pre47 app/models/lending_policy.rb
enju_circulation-0.1.0.pre46 app/models/lending_policy.rb
enju_circulation-0.1.0.pre45 app/models/lending_policy.rb
enju_circulation-0.1.0.pre44 app/models/lending_policy.rb
enju_circulation-0.1.0.pre43 app/models/lending_policy.rb