app/models/item.rb in enju_biblio-0.1.0.pre42 vs app/models/item.rb in enju_biblio-0.1.0.pre43
- old
+ new
@@ -13,15 +13,15 @@
scope :on_shelf, where('shelf_id != 1')
scope :on_web, where(:shelf_id => 1)
has_one :exemplify, :dependent => :destroy
has_one :manifestation, :through => :exemplify
has_many :owns
- has_many :patrons, :through => :owns
+ has_many :agents, :through => :owns
delegate :display_name, :to => :shelf, :prefix => true
belongs_to :bookstore, :validate => true
has_many :donates
- has_many :donors, :through => :donates, :source => :patron
+ has_many :donors, :through => :donates, :source => :agent
belongs_to :required_role, :class_name => 'Role', :foreign_key => 'required_role_id', :validate => true
has_one :resource_import_result
belongs_to :budget_type
#accepts_nested_attributes_for :exemplify
#before_save :create_manifestation
@@ -41,11 +41,11 @@
integer :required_role_id
integer :manifestation_id do
manifestation.id if manifestation
end
integer :shelf_id
- integer :patron_ids, :multiple => true
+ integer :agent_ids, :multiple => true
time :created_at
time :updated_at
time :acquired_at
end
@@ -67,11 +67,11 @@
def publisher
manifestation.try(:publisher)
end
- def owned(patron)
- owns.where(:patron_id => patron.id).first
+ def owned(agent)
+ owns.where(:agent_id => agent.id).first
end
def manifestation_url
Addressable::URI.parse("#{LibraryGroup.site_config.url}manifestations/#{self.manifestation.id}").normalize.to_s if self.manifestation
end