lib/kredis/railtie.rb in kredis-0.2.0 vs lib/kredis/railtie.rb in kredis-0.2.1

- old
+ new

@@ -18,12 +18,12 @@ initializer "kredis.configurator" do Kredis.configurator = Rails.application end initializer "kredis.attributes" do - # TODO: Add run_load_hooks to ActiveModel::Model so this runs. - ActiveSupport.on_load(:active_model) do - include Kredis::Attributes + # No load hook for Active Model, just defer until after initialization. + config.after_initialize do + ActiveModel::Model.include Kredis::Attributes if defined?(ActiveModel::Model) end ActiveSupport.on_load(:active_record) do include Kredis::Attributes end