Sha256: 0c7608cec16bc78463abb5fe34e1728b7014e4add5d7b5a11e70623d422ca37a
Contents?: true
Size: 1.94 KB
Versions: 2
Compression:
Stored size: 1.94 KB
Contents
require 'responders' require 'jquery-rails' require 'authlogic' require 'bootstrap-sass' require 'will_paginate' require 'will_paginate-bootstrap' require 'breadcrumbs_on_rails' require 'rails-ujs' require 'sortable_by' module Spud end module TbCore class Engine < ::Rails::Engine require "#{root}/lib/tb_core/errors" require "#{root}/lib/tb_core/form_builder" require "#{root}/lib/tb_core/searchable" require "#{root}/lib/tb_core/spud_core" engine_name :tb_core config.autoload_paths << "#{root}/lib" initializer 'tb_core.admin', after: :admin do # Translate Hash configured permissions into SpudPermission objects TbCore.permissions.collect! do |p| if p.is_a? Hash SpudPermission.new(p[:tag], p[:name], p[:apps]) else p end end # Append Users admin module TbCore.config.admin_applications.unshift(name: 'Users', thumbnail: 'admin/users_thumb.png', url: '/admin/users', order: 100) # Create default permissions for modules TbCore.admin_applications.each do |admin_application| admin_application[:key] ||= admin_application[:name].tr(' ', '_').downcase.to_sym tag = "admin.#{admin_application[:key]}.full_access" name = "#{admin_application[:name]} admin" apps = [admin_application[:key]] TbCore.permissions.push(SpudPermission.new(tag, name, apps)) end end initializer 'tb_core.catch_all_route' do |config| # Handle 404 errors if Spud::Cms is not installed unless defined?(Spud::Cms) config.routes_reloader.paths << File.expand_path('../catch_all_route.rb', __FILE__) end end initializer 'tb_core.assets' do Rails.application.config.assets.precompile += ['admin/users_thumb.png', 'admin/module_icon.png'] end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
tb_core-1.4.5 | lib/tb_core/engine.rb |
tb_core-1.4.4 | lib/tb_core/engine.rb |