Sha256: 37455860f4935785c6d6b74cba8ff594f6fa938871c44b725fa5f2bee25340ad
Contents?: true
Size: 1.48 KB
Versions: 19
Compression:
Stored size: 1.48 KB
Contents
module WidgetList class Railtie < Rails::Railtie config.before_configuration do config_file = Rails.root.join("config", "widget-list.yml") if config_file.file? # WidgetList::List::connect else puts "\nWidget List config not found. Creating config/widget-list.yml. \n\nPlease configure it with the appropriate connections" File.open(Rails.root.join("config", "widget-list.yml"), 'w') { |file| file.write("#For connection examples see: http://sequel.rubyforge.org/rdoc/files/doc/opening_databases_rdoc.html\n\n") file.write("development:\n") file.write(" :primary: sqlite:/\n") file.write(" :secondary: sqlite:/\n") file.write("\n") file.write("test:\n") file.write(" :primary: sqlite:/\n") file.write(" :secondary: sqlite:/\n") file.write("\n") file.write("release:\n") file.write(" :primary: sqlite:/\n") file.write(" :secondary: sqlite:/\n") file.write("\n") file.write("production:\n") file.write(" :primary: sqlite:/\n") file.write(" :secondary: sqlite:/\n") } end end initializer "Include widget_list" do ActiveSupport.on_load(:action_controller) do if WidgetList::List::is_sequel(true) || WidgetList::List::is_sequel(false) require 'sequel' end require 'widget_list/sequel' end end end end
Version data entries
19 entries across 19 versions & 1 rubygems