lib/has_setting.rb in has_setting-0.4.6 vs lib/has_setting.rb in has_setting-0.5
- old
+ new
@@ -1,11 +1,12 @@
# Intialize the gem by including some extension to ActiveRecord::Base
require File.dirname(__FILE__) + '/has_setting/ar_extensions'
require File.dirname(__FILE__) + '/has_setting/formatters'
require File.dirname(__FILE__) + '/has_setting/setting'
-ActiveRecord::Base.class_eval do
- include(HasSetting::InstanceMethods)
- extend(HasSetting::ClassMethods)
+
+
+ActiveSupport.on_load(:active_record) do
+ include HasSetting
end
HasSetting::Formatters.register_formatter(:string, HasSetting::Formatters::StringFormatter.new)
HasSetting::Formatters.register_formatter(:strings, HasSetting::Formatters::StringsFormatter.new)
\ No newline at end of file