Sha256: b6043359ef2a67d80c2d49e77fb53d410a44c7880cccc9ea684bc61238190faf

Contents?: true

Size: 1.08 KB

Versions: 1

Compression:

Stored size: 1.08 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::HelperTools
    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.5 lib/freeberry/railtie.rb