Skipp callbacks in Mongoid

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Done
    • 3.0.15
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • 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?

              Assignee:
              Unassigned
              Reporter:
              JohnBat26 [X]
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: