Created
January 17, 2010 21:04
-
-
Save gstark/279582 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
in application.rb | |
config.active_record.observers = :foo_observer | |
foo_observer.rb: | |
class FooObserver < ActiveRecord::Observer | |
def before_update(foo) | |
end | |
end | |
foo.rb model: | |
class Foo < ActiveRecord::Base | |
include SomethingFromPlugin | |
end | |
This causes a 'uninitialized constant' for SomethingFromPlugin because the plugins aren't loaded yet. | |
rails/activerecord/lib/active_record/observer.rb:91 is causing the Foo model to load, through a chain of ActiveModel#observing => ActiveModel#observed_classes => ActiveModel#observed_class => constantize | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment