# Be sure to restart your webserver when you modify this file. # Uncomment below to force Rails into production mode # (Use only when you can't set environment variables through your web/app server) # RAILS_ENV = ENV['RAILS_ENV'] || 'production' # Bootstrap the Rails environment, frameworks, and default configuration require File.join(File.dirname(__FILE__), 'boot') Rails::Initializer.run do |config| # Skip frameworks you're not going to use config.frameworks -= [ :action_web_service ] # Add additional load paths for your own custom dirs config.load_paths += Dir[File.join(RAILS_ROOT, 'vendor', '*[0-9]', 'lib')] config.load_paths << File.join(RAILS_ROOT, "app", "behaviors") config.load_paths << File.join(RAILS_ROOT, "app", "liquid_tags") config.load_paths << File.join(RAILS_ROOT, "app", "liquid_filters") config.load_paths << File.join(RAILS_ROOT, "app", "drops") config.load_paths << File.join(RAILS_ROOT, "app", "concerns") config.load_paths << File.join(RAILS_ROOT, "app", "futures") config.load_paths << File.join(RAILS_ROOT, "lib", "workers") # Force all environments to use the same logger level # (by default production uses :info, the others :debug) config.log_level = :debug # Use the database for sessions instead of the file system # (create the session table with 'rake create_sessions_table') config.action_controller.session_store = :active_record_store # Activate observers that should always be running config.active_record.observers = (Dir[File.join(RAILS_ROOT, 'app', 'models', '*_sweeper.rb')] + Dir[File.join(RAILS_ROOT, 'app', 'models', '*_observer.rb')]).map do |file| File.basename(file).sub('.rb', '').to_sym end # Make Active Record use UTC-base instead of local time config.active_record.default_timezone = :utc #config.plugins = ["engines", "*"] # Use Active Record's schema dumper instead of SQL when creating the test database # (enables use of different database adapters for development and test environments) config.active_record.schema_format = :sql config.active_record.colorize_logging = false # See Rails::Configuration for more options end # Add new inflection rules using the following format # (all these examples are active by default): # Inflector.inflections do |inflect| # inflect.plural /^(ox)$/i, '\1en' # inflect.singular /^(ox)en/i, '\1' # inflect.irregular 'person', 'people' # inflect.uncountable %w( fish sheep ) # end # Include your app's configuration here: ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS[:session_key] = "session_id" require "smalltalk" gem "mocha", ">= 0.3.2" require "mocha" gem "builder", ">= 2.0.0" require "builder" gem "chronic", ">= 0.1.6" require "chronic" gem "money", ">= 1.7.1" require "money" gem "paypal", ">= 2.0.0" require "paypal" gem "pdf-writer", ">= 1.1.3" require "pdf/simpletable" # PDF::SimpleTable is not loaded by the main PdfWriter gem "RedCloth", ">= 3.0.4" require "redcloth" gem "uuidtools", ">= 1.0.0" require "uuidtools" gem "paginator", ">= 1.0.8" require "paginator" gem "transaction-simple", ">= 1.4.0" require "transaction/simple" require "uuid_generator" require "acts_as_fulltext" # We cannot gem here, because FeedTools depends on ActiveRecord, and # it will activate the Gem version of ActiveRecord. This version might not # be the one we need, so we must have an unpacked version of FeedTools in # vendor/. #gem "feedtools", ">= 0.2.26" require 'feed_tools' # Load without Gem, this should load the unpacked version # Don't require a specific version of RMagick, but do require one require "RMagick" # Load our custom extensions require 'array_extensions' require 'money_extensions' Money.default_currency = 'CAD' InchesPerFeet = 12.0 ItemsPerPage = 10 # 30 items per page, when navigation is required # Internal use only FileUtils.mkdir_p(Picture.root_path) FeedTools.configurations[:feed_cache] = FeedTools::DatabaseFeedCache FULL_DAY_NAMES = %w(Sunday Monday Tuesday Wednesday Thursday Friday Saturday) FULL_MONTH_NAMES = %w(January February March April May June July August September November December) # "Fix" Criteria::Query, if it hasn't received the patch that has a #count method unless Criteria::Query.public_instance_methods(false).map(&:to_s).include?('count') require 'extensions/criteria_query' end String.send :include, XlSuite::SlugHelper FightTheMelons::Helpers::FormMultipleSelectHelperConfiguration.outer_class = 'multiple_select' FightTheMelons::Helpers::FormMultipleSelectHelperConfiguration.alternate = true Liquid::Template.register_tag('render_feed', XlSuite::RenderFeed) Liquid::Template.register_tag('render_feeds', XlSuite::RenderFeed) Liquid::Template.register_tag('download_link', XlSuite::DownloadLink) Liquid::Template.register_tag('image', XlSuite::Image) Liquid::Template.register_tag('render_snippet', XlSuite::RenderSnippet) Liquid::Template.register_tag('render_snippets', XlSuite::RenderSnippet) Liquid::Template.register_tag('render_date', XlSuite::RenderDate) Liquid::Template.register_tag('google_analytics', XlSuite::GoogleAnalytics) Liquid::Template.register_tag('flash', XlSuite::Flash) Liquid::Template.register_tag('opt_out_url', XlSuite::OptOutUrl) Liquid::Template.register_tag('params', XlSuite::Params) Liquid::Template.register_tag('load_profiles', XlSuite::LoadProfiles) Liquid::Template.register_tag('load_profile', XlSuite::LoadProfile) Liquid::Strainer.send :include, Textilize Liquid::Strainer.send :include, Whitelist ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS[:iso] = "%Y-%m-%d" ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS[:iso] = "%Y-%m-%dT%H:%M:%S" ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS[:time_only] = "%H:%M" WhiteListHelper.tags.merge %w(meta dl dd dt input form select option label table caption thead tbody tfoot tr th td) WhiteListHelper.attributes.merge %w(id style action type name value) Liquid::Context.send :include, XlSuite::Liquid::ContextHelpers Liquid::Tag.send :include, XlSuite::LoggerHelper REJECTED_RETURN_TO_PATH = /(^\/admin$|^\/admin\/ui|^\/javascripts|\.xml\?|\.json\?|^\/sessions|^\/stylesheets\/)/i.freeze ActiveRecord::Base.send :include, ReportGenerator # Load report model objects so that they exist in memory and YAML::load can # instantiate the correct classes, or else the objects are left as YAML::Object. Dir[File.join(RAILS_ROOT, "app", "models", "report*.rb")].each do |filename| File.basename(filename, ".rb").classify.constantize end unless %w(development test).include?(RAILS_ENV) then require File.dirname(__FILE__) + "/environments/futures" require File.dirname(__FILE__) + "/environments/observers" end