Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor pages/engine class into it's own file
- Loading branch information
Jamie Winsor
committed
Sep 8, 2011
1 parent
be92877
commit b24b591
Showing
2 changed files
with
47 additions
and
44 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
module Refinery | ||
module Pages | ||
class Engine < ::Rails::Engine | ||
isolate_namespace ::Refinery | ||
|
||
config.before_initialize do | ||
require 'pages/marketable_urls' | ||
end | ||
|
||
config.to_prepare do | ||
require 'pages/tabs' | ||
require 'pages/marketable_urls' | ||
::Refinery::Page.translation_class.send(:is_seo_meta) | ||
# set allowed attributes for mass assignment | ||
::Refinery::Page.translation_class.send(:attr_accessible, :browser_title, :meta_description, :meta_keywords, :locale) | ||
end | ||
|
||
refinery.after_inclusion do | ||
::ApplicationController.send :include, ::Refinery::Pages::InstanceMethods | ||
::Refinery::AdminController.send :include, ::Refinery::Pages::Admin::InstanceMethods | ||
end | ||
|
||
initializer "init plugin", :after => :set_routes_reloader do |app| | ||
::Refinery::Plugin.register do |plugin| | ||
plugin.pathname = root | ||
plugin.name = 'refinery_pages' | ||
plugin.directory = 'pages' | ||
plugin.version = %q{2.0.0} | ||
plugin.menu_match = /refinery\/page(_part)?s(_dialogs)?$/ | ||
plugin.url = app.routes.url_helpers.refinery_admin_pages_path | ||
plugin.activity = { | ||
:class => ::Refinery::Page, | ||
:url_prefix => "edit", | ||
:title => "title", | ||
:created_image => "page_add.png", | ||
:updated_image => "page_edit.png" | ||
} | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains 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