diff --git a/lib/validates_timeliness.rb b/lib/validates_timeliness.rb index 6e178315..bb05b9a2 100644 --- a/lib/validates_timeliness.rb +++ b/lib/validates_timeliness.rb @@ -58,6 +58,10 @@ def self.parser # Setup method for plugin configuration def self.setup yield self + load_orms + end + + def self.load_orms extend_orms.each {|orm| require "validates_timeliness/orm/#{orm}" } end end diff --git a/lib/validates_timeliness/railtie.rb b/lib/validates_timeliness/railtie.rb index 6b4bb266..6b88d616 100644 --- a/lib/validates_timeliness/railtie.rb +++ b/lib/validates_timeliness/railtie.rb @@ -3,7 +3,8 @@ class Railtie < Rails::Railtie initializer "validates_timeliness.initialize_active_record", :after => 'active_record.initialize_timezone' do ActiveSupport.on_load(:active_record) do ValidatesTimeliness.default_timezone = ActiveRecord::Base.default_timezone - ValidatesTimeliness.extend_orms = [ :active_record ] + ValidatesTimeliness.extend_orms << :active_record + ValidatesTimeliness.load_orms end end