Created
November 16, 2010 16:25
-
-
Save neotericdesign/702011 to your computer and use it in GitHub Desktop.
this worked in Rails2 RefineryCMS -- in the initializers folder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Page | |
| acts_as_commentable | |
| has_many :page_widget_assignments | |
| has_many :assigned_widgets, :through => :page_widget_assignments, :source => :widget | |
| def widgets | |
| if assigned_widgets.blank? | |
| parent_id? ? parent.widgets : Widget.system | |
| else | |
| assigned_widgets | |
| end | |
| end | |
| def body | |
| return self[:body] | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment