Class: Exemplify

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/exemplify.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.per_pageObject



14
15
16
# File 'app/models/exemplify.rb', line 14

def self.per_page
  10
end

Instance Method Details

#create_lending_policyObject



23
24
25
26
27
# File 'app/models/exemplify.rb', line 23

def create_lending_policy
  UserGroupHasCheckoutType.available_for_item(item).each do |rule|
    LendingPolicy.create!(:item_id => item.id, :user_group_id => rule.user_group_id, :fixed_due_date => rule.fixed_due_date, :loan_period => rule.checkout_period, :renewal => rule.checkout_renewal_limit)
  end
end

#reindexObject



18
19
20
21
# File 'app/models/exemplify.rb', line 18

def reindex
  manifestation.try(:index)
  item.try(:index)
end