Skip to content

Commit

Permalink
Fix mass assignment errors. Closes #69.
Browse files Browse the repository at this point in the history
Conflicts:

	app/models/refinery/portfolio/gallery.rb
  • Loading branch information
ugisozols committed Apr 30, 2012
1 parent 75c382d commit 9e178dc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions app/models/refinery/portfolio/gallery.rb
Expand Up @@ -8,6 +8,10 @@ class Gallery < Refinery::Core::BaseModel
friendly_id :title, :use => [:slugged]
translates :title, :body

class Translation
attr_accessible :locale
end

has_many :items

attr_accessible :title, :body, :lft, :rgt,
Expand Down
6 changes: 5 additions & 1 deletion app/models/refinery/portfolio/item.rb
Expand Up @@ -4,7 +4,11 @@ class Item < ActiveRecord::Base

translates :title, :caption

attr_accessible :title, :caption, :image_id, :gallery_id, :position, :locale
class Translation
attr_accessible :locale
end

attr_accessible :title, :caption, :image_id, :gallery_id, :position
validates :gallery_id, :numericality => {:allow_nil => true}
validates :image_id, :presence => true, :numericality => true

Expand Down

0 comments on commit 9e178dc

Please sign in to comment.