lib/surrounded/railtie.rb in surrounded-rails-0.0.2 vs lib/surrounded/railtie.rb in surrounded-rails-0.0.3
- old
+ new
@@ -2,11 +2,11 @@
require "surrounded"
require "rails"
module Surrounded
class Railtie < ::Rails::Railtie
initializer 'surrounded.active_record' do |app|
- ActiveRecord::Base.send(:include, ::Surrounded)
ActiveRecord::Base.class_eval {
+ include Surrounded
# This relies on a private method (present in Rails 3 and 4)
# because there is no earlier hook to set this variable.
# The after_initialize callback occurs to late because
# the initialize method has a procedure which calls
# respond_to? and Surrounded adds respond_to_missing?