Permalink
Browse files

Replacing model.id calls with model[:id]

  • Loading branch information...
1 parent 2c01445 commit 6b0fe4cabf2377c6c2ce37ada8fb1499fead05d1 @jeremyf jeremyf committed Jul 11, 2012
Showing with 4 additions and 4 deletions.
  1. +2 −2 app/models/atrium/collection.rb
  2. +2 −2 app/models/atrium/exhibit.rb
@@ -68,12 +68,12 @@ def remove_collection_of_facets_by_name(collection_of_facet_names)
def exhibit_order
exhibit_order = {}
- exhibits.map{|exhibit| exhibit_order[exhibit.id] = exhibit.set_number }
+ exhibits.map{|exhibit| exhibit_order[exhibit[:id]] = exhibit.set_number }
exhibit_order
end
def exhibit_order=(exhibit_order = {})
- valid_ids = exhibits.select(:id).map{|exhibit| exhibit.id}
+ valid_ids = exhibits.select(:id).map{|exhibit| exhibit[:id]}
exhibit_order.each_pair do |id, order|
Atrium::Exhibit.find(id).update_attributes!(:set_number => order) if valid_ids.include?(id.to_i)
end
@@ -38,12 +38,12 @@ def browse_facet_names
def facet_order
facet_order = {}
- browse_levels.map{|facet| facet_order[facet.id] = facet.level_number }
+ browse_levels.map{|facet| facet_order[facet[:id]] = facet.level_number }
facet_order
end
def facet_order=(facet_order = {})
- valid_ids = browse_levels.select(:id).map{|facet| facet.id}
+ valid_ids = browse_levels.select(:id).map{|facet| facet[:id]}
facet_order.each_pair do |id, order|
Atrium::BrowseLevel.find(id).update_attributes!(:level_number => order) if valid_ids.include?(id.to_i)
end

0 comments on commit 6b0fe4c

Please sign in to comment.