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
I need to make call while disabling one of the observers, but there is something I have noticed. Due to some sensitive information, I'll replace the names of classes. For the purpose of this issue, I am using Rails 4.2.11 and rails-observer 0.1.5.
I've tried all of these on the rails console:
ActiveRecord::Base.observers returns all of the observers I have defined in config.active_record.observers.
Foo.observers returns an empty array, even though I do have FooObserver and it's in config.active_record.observers. I even checked to make sure ActiveRecord::Base.observers has foo_observer which appears to be the case.
So I then tried to disable by calling ActiveRecord::Base.observers.disable :foo_observer, but got the following output:
=> [PgSearch::Document(Table doesn't exist),
ApplicationRecord(abstract),
... the rest may be irrelevant, since it's all model definitions. Interestingly enough, I don't see the model Foo in the list, even though it does exist and I can invoke it...
]
I hope this is enough information and hope someone has a good solution on how I can get around it.
The text was updated successfully, but these errors were encountered:
Hi all,
I need to make call while disabling one of the observers, but there is something I have noticed. Due to some sensitive information, I'll replace the names of classes. For the purpose of this issue, I am using Rails 4.2.11 and rails-observer 0.1.5.
I've tried all of these on the rails console:
ActiveRecord::Base.observers
returns all of the observers I have defined inconfig.active_record.observers
.Foo.observers
returns an empty array, even though I do haveFooObserver
and it's inconfig.active_record.observers
. I even checked to make sureActiveRecord::Base.observers
hasfoo_observer
which appears to be the case.ActiveRecord::Base.observers.disable :foo_observer
, but got the following output:I hope this is enough information and hope someone has a good solution on how I can get around it.
The text was updated successfully, but these errors were encountered: