You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ rails s
=> Booting Thin
=> Rails 4.2.4 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
Exiting
/Users/User/.rvm/gems/ruby-2.3.0@code/gems/attr_encrypted-1.3.5/lib/attr_encrypted.rb:259:in `method_missing': undefined method `add_observer' for Buccaneer::EntryMailer:Class (NoMethodError)
from /Users/User/.rvm/gems/ruby-2.3.0@code/gems/actionmailer-4.2.4/lib/action_mailer/base.rb:569:in `method_missing'
from /Users/User/.rvm/gems/ruby-2.3.0@code/gems/rails-observers-0.1.2/lib/rails/observers/active_model/observing.rb:364:in `add_observer!'
from /Users/User/.rvm/gems/ruby-2.3.0@code/gems/rails-observers-0.1.2/lib/rails/observers/activerecord/observer.rb:105:in `add_observer!'
from /Users/User/.rvm/gems/ruby-2.3.0@code/gems/rails-observers-0.1.2/lib/rails/observers/active_model/observing.rb:341:in `block in initialize'
from /Users/User/.rvm/gems/ruby-2.3.0@code/gems/rails-observers-0.1.2/lib/rails/observers/active_model/observing.rb:341:in `each'
from /Users/User/.rvm/gems/ruby-2.3.0@code/gems/rails-observers-0.1.2/lib/rails/observers/active_model/observing.rb:341:in `initialize'
I will add any further details if I discover any.
The text was updated successfully, but these errors were encountered:
OK, I fixed by not setting config.active_record.observers= in engine.rb nor having an observe class method call in Observer, yet instead just using register_observer class method call in Mailer itself. Must be a special issue with Rails Mailer Observers.
Still, it would be nice not to get that exception for add_observer (is that old API?) when I register via observe class method in Observer instead of using register_observer
AndyObtiva
changed the title
Having an issue using Observer from Rails Engine
add_observer exception when using Observer for Mailer from Rails Engine
May 11, 2016
AndyObtiva
changed the title
add_observer exception when using Observer for Mailer from Rails Engine
undefined method add_observer when using Observer for Mailer from Rails Engine
May 11, 2016
I keep getting this error when I start a Rails 4.2.4 application consuming a Rails Engine with a Mailer Observer configured.
Details are below with some code information replaced with placeholders to protect my client's code rights.
engine.rb configuration:
observer code:
Error:
I will add any further details if I discover any.
The text was updated successfully, but these errors were encountered: