Sha256: c74625b209e87e30fb72d0919e4a7fe66e34b334036e29ae7ba9c26c98eb89c8

Contents?: true

Size: 1.6 KB

Versions: 12

Compression:

Stored size: 1.6 KB

Contents

def d(var)
  raise var.inspect.split(', ').join(",\n")
end
require 'haml'
require 'kaminari'

module Bhf
  class Engine < Rails::Engine

    # Config defaults
    config.page_title = nil
    config.mount_at = 'bhf'
    config.on_login_fail = :root_url
    config.logout_path = :logout_path
    config.session_auth_name = :is_admin
    config.session_account_id = :admin_account_id
    config.account_model = 'User'
    config.account_model_find_method = 'find'
    config.css = []
    
    config.bhf_routes = lambda {
      namespace :bhf, path: Bhf::Engine.config.mount_at do
        root to: 'application#index'

        get 'page/:page', to: 'pages#show', as: :page

        scope ':platform' do
          resources :entries, except: [:index] do
            put :sort, on: :collection

            resources :embed_entries, except: [:index, :show], as: :embed
            post :duplicate, on: :member
          end
        end

      end
    }

    
    config.remove_default_routes = false
    
    # config.bhf_logic = YAML::load(IO.read('config/bhf.yml'))

  end
end

require 'bhf/i18n'
require 'bhf/active_record/active_record'
require 'bhf/active_record/upload'
require 'bhf/mongoid/document'
require 'bhf/view_helpers'
require 'bhf/data'
require 'bhf/platform'
require 'bhf/settings'
require 'bhf/pagination'
require 'bhf/form'

::I18n.send :include, Bhf::I18nTranslationFallbackHelper

if defined?(ActiveRecord)
  ::ActiveRecord::Base.send :include, Bhf::ActiveRecord::Object
end
if defined?(Mongoid)
  ::Mongoid::Document.send :include, Bhf::Mongoid::Document
end

::ActionView::Base.send :include, Bhf::ViewHelpers::ActionView

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
bhf-0.6.0 lib/bhf.rb
bhf-0.5.13 lib/bhf.rb
bhf-0.5.12 lib/bhf.rb
bhf-0.5.11 lib/bhf.rb
bhf-0.5.10 lib/bhf.rb
bhf-0.5.9 lib/bhf.rb
bhf-0.5.8 lib/bhf.rb
bhf-0.5.7 lib/bhf.rb
bhf-0.5.6 lib/bhf.rb
bhf-0.5.5 lib/bhf.rb
bhf-0.5.4 lib/bhf.rb
bhf-0.5.3 lib/bhf.rb