Skip to content

Instantly share code, notes, and snippets.

@moretea
Created October 13, 2010 10:24
Show Gist options
  • Select an option

  • Save moretea/623796 to your computer and use it in GitHub Desktop.

Select an option

Save moretea/623796 to your computer and use it in GitHub Desktop.
# In a engine
class Engine < Rails::Engine
config.after_initialize do
Page.send(:include, PageClassMethods)
end
end
module PageClassMethods
def self.included(klass)
klass.belongs_to :layout, :class_name => "PageLayout", :foreign_key => :page_layout_id
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment