-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
None
I have a entity.
And it hase two callbacks :
before_save :fields_to_model
after_initialize :model_to_fields
And I want skip my callbacks in cucumber tests:
I try:
Conference.skip_callback(:save, :before)
@conference = FactoryGirl.build(:conference, user: @user)
@conference.save(validate: false)
Conference.set_callback(:save, :before)
But before_save callback invokes again.
Q: How can I disable callbacks in Mongoid at runtime?