Sha256: 28a80bfe97cf06b05d6141dfaa90193a1b6a5e20c7d1e0daa212a4f50ed0f714

Contents?: true

Size: 1.11 KB

Versions: 1

Compression:

Stored size: 1.11 KB

Contents

# encoding: utf-8
require 'rails'
require 'freeberry'

module Freeberry
  class Engine < ::Rails::Engine   
    config.before_initialize do
      ::ActiveSupport::XmlMini.backend = 'Nokogiri'
      
      ::Responders::FlashResponder.flash_keys = [ :success, :failure ]
      ::InheritedResources.flash_keys = [ :success, :failure ]
        
      config.i18n.load_path += Dir[File.join(File.dirname(__FILE__), "../../config", 'locales', '**', '*.{rb,yml}').to_s]
      
      ::I18n::Backend::Simple.send(:include, ::I18n::Backend::Pluralization)
      
      ::ActiveSupport.on_load :active_record do
        ::ActiveRecord::Base.send :include, Freeberry::MysqlUtils
        ::ActiveRecord::Base.send :include, Freeberry::AccessibleAttributes
      end
    end
    
    config.after_initialize do
      ::ActionController::Base.send :include, Freeberry::Controllers::AuthorizedSystem
      ::ActionController::Base.send :include, Freeberry::Controllers::HeadOptions
    
      ::ActionView::Base.send :include, Freeberry::Controllers::HelperUtils
    end
    
    rake_tasks do
      load "tasks/freeberry.rake"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
freeberry-0.2.7 lib/freeberry/railtie.rb