Skip to content
Browse files

Fix mass assignment errors. Closes #69.

  • Loading branch information...
1 parent 7ae7a0a commit 34947e5fd7e7a175a9a0211d2288e828d85751be @ugisozols ugisozols committed
Showing with 10 additions and 2 deletions.
  1. +5 −1 app/models/refinery/portfolio/gallery.rb
  2. +5 −1 app/models/refinery/portfolio/item.rb
View
6 app/models/refinery/portfolio/gallery.rb
@@ -8,11 +8,15 @@ class Gallery < Refinery::Core::BaseModel
friendly_id :title, :use => [:slugged]
translates :title, :body
+ class Translation
+ attr_accessible :locale
+ end
+
has_many :items, :dependent => :destroy
attr_accessible :title, :body, :lft, :rgt,
:position, :gallery_type, :depth,
- :parent_id, :images, :locale
+ :parent_id, :images
alias_attribute :description, :body
View
6 app/models/refinery/portfolio/item.rb
@@ -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

0 comments on commit 34947e5

Please sign in to comment.
Something went wrong with that request. Please try again.