Sha256: 3f50561e8bb31764882b12f55a5328c1b340285aad0c25e360c8b5929bb9ebd6

Contents?: true

Size: 1.71 KB

Versions: 39

Compression:

Stored size: 1.71 KB

Contents

# -*- encoding: utf-8 -*-
class UserGroup < ActiveRecord::Base
  attr_accessible :name, :display_name, :note, :valid_period_for_new_user,
    :expired_at, :number_of_day_to_notify_overdue,
    :number_of_day_to_notify_overdue,
    :number_of_day_to_notify_due_date,
    :number_of_time_to_notify_overdue

  include MasterModel
  default_scope :order => "user_groups.position"
  has_many :users

  validates_numericality_of :valid_period_for_new_user,
    :greater_than_or_equal_to => 0,
    :allow_blank => true

  def self.per_page
    10
  end

  if defined?(EnjuCirculation)
    has_many :user_group_has_checkout_types, :dependent => :destroy
    has_many :checkout_types, :through => :user_group_has_checkout_types, :order => :position
    has_many :lending_policies

    validates_numericality_of :number_of_day_to_notify_due_date,
      :number_of_day_to_notify_overdue,
      :number_of_time_to_notify_overdue,
      :greater_than_or_equal_to => 0
  end
end

# == Schema Information
#
# Table name: user_groups
#
#  id                               :integer         not null, primary key
#  name                             :string(255)
#  display_name                     :text
#  note                             :text
#  position                         :integer
#  created_at                       :datetime
#  updated_at                       :datetime
#  deleted_at                       :datetime
#  valid_period_for_new_user        :integer         default(0), not null
#  expired_at                       :datetime
#  number_of_day_to_notify_overdue  :integer         default(1), not null
#  number_of_day_to_notify_due_date :integer         default(7), not null
#  number_of_time_to_notify_overdue :integer         default(3), not null
#

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
enju_circulation-0.0.66 spec/dummy/app/models/user_group.rb
enju_circulation-0.0.65 spec/dummy/app/models/user_group.rb
enju_circulation-0.0.64 spec/dummy/app/models/user_group.rb
enju_circulation-0.0.63 spec/dummy/app/models/user_group.rb
enju_circulation-0.0.62 spec/dummy/app/models/user_group.rb
enju_circulation-0.0.61 spec/dummy/app/models/user_group.rb
enju_circulation-0.0.60 spec/dummy/app/models/user_group.rb
enju_circulation-0.0.59 spec/dummy/app/models/user_group.rb
enju_circulation-0.0.58 spec/dummy/app/models/user_group.rb
enju_circulation-0.0.57 spec/dummy/app/models/user_group.rb
enju_circulation-0.0.56 spec/dummy/app/models/user_group.rb
enju_circulation-0.0.55 spec/dummy/app/models/user_group.rb
enju_circulation-0.0.54 spec/dummy/app/models/user_group.rb
enju_circulation-0.0.53 spec/dummy/app/models/user_group.rb
enju_circulation-0.0.52 spec/dummy/app/models/user_group.rb
enju_circulation-0.0.51 spec/dummy/app/models/user_group.rb
enju_circulation-0.0.50 spec/dummy/app/models/user_group.rb
enju_circulation-0.0.49 spec/dummy/app/models/user_group.rb
enju_circulation-0.0.48 spec/dummy/app/models/user_group.rb