patch_file/lib/patchfile/engine.rb

39 lines
1.6 KiB
Ruby
Raw Normal View History

2019-09-28 11:48:59 +00:00
require "yaml"
module Patchfile
class Engine < ::Rails::Engine
initializer "patchfile" do
2019-10-01 14:26:53 +00:00
OrbitApp.registration "Patchfile", :type => "ModuleApp" do
2019-10-05 07:57:32 +00:00
module_label "patchfile.patchfile"
2019-09-28 11:48:59 +00:00
base_url File.expand_path File.dirname(__FILE__)
2019-09-30 16:04:09 +00:00
taggable "patchfilefield"
2019-09-28 11:48:59 +00:00
categorizable
authorizable
data_count 1..30
side_bar do
2019-09-30 16:04:09 +00:00
head_label_i18n 'patchfile.patchfile', icon_class: "icons-megaphone"
2019-09-28 11:48:59 +00:00
available_for "users"
active_for_controllers (['admin/patchfiles'])
head_link_path "admin_patchfiles_path"
2019-09-30 16:04:09 +00:00
context_link 'patchfile.patchfile',
2019-09-28 11:48:59 +00:00
:link_path=>"admin_patchfiles_path" ,
:priority=>1,
:active_for_action=>{'admin/patchfiles'=>'index'},
:available_for => 'users'
context_link 'CKEDITOR',
:link_path=>"admin_patchfiles_showckeditor_path" ,
#:link_to=>"admin_patchfiles_path"+"/showckeditor" ,
:priority=>2,
:active_for_action=>{'admin/patchfiles'=>'showckeditor'},
:available_for => 'users'
end
end
# temp = YAML.load_file(File.join(Rails.root,"config","mongoid.yml"))
# dbsettings = temp["production"]["sessions"]["default"]
# s = Moped::Session.new(dbsettings["hosts"])
# s.use dbsettings["database"]
# s[:bulletins].indexes.create({expirable_created_at: 1},{ expireAfterSeconds: 180 })
end
end
end