lib/amee.rb in amee-3.2.1 vs lib/amee.rb in amee-4.0.0
- old
+ new
@@ -2,10 +2,11 @@
# Released as Open Source Software under the BSD 3-Clause license. See LICENSE.txt for details.
require 'rexml/document'
require 'nokogiri'
require 'active_support'
+require 'active_support/time'
require 'log4r'
# We don't NEED the JSON gem, but if it's available, use it.
begin
require 'json'
@@ -51,9 +52,19 @@
require 'amee/pager'
require 'amee/item_definition'
require 'amee/item_value_definition'
require 'amee/user'
require 'amee/v3'
+
+if defined?(Rails)
+ require 'amee/rails'
+ ActiveRecord::Base.send :include, AMEE::Rails
+
+ amee_config = "config/amee.yml"
+ if File.exist?(amee_config)
+ $AMEE_CONFIG = YAML.load_file(amee_config)[Rails.env]
+ end
+end
class Date
def amee1_date
strftime("%Y%m%d")
end