Skip to content

Commit

Permalink
Merge pull request spree-contrib#48 from ethier/master
Browse files Browse the repository at this point in the history
Add attr_accessible to page.rb
  • Loading branch information
peterberkenbosch committed Apr 6, 2012
2 parents 4086c5b + 8a57e4f commit 4aca671
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/models/spree/page.rb
Expand Up @@ -9,11 +9,13 @@ class Spree::Page < ActiveRecord::Base
scope :footer_links, where(:show_in_footer => true).visible
scope :sidebar_links, where(:show_in_sidebar => true).visible


before_save :update_positions_and_slug

attr_accessible :title, :slug, :body, :meta_title, :meta_keywords, :meta_description, :layout, :foreign_link, :position, :show_in_sidebar, :show_in_header, :show_in_footer, :visible

def initialize(*args)
super(*args)

last_page = Spree::Page.last
self.position = last_page ? last_page.position + 1 : 0
end
Expand Down

0 comments on commit 4aca671

Please sign in to comment.