Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-2569

New value of attribute reset in after_inilialize callback ...

    • Type: Icon: Task Task
    • Resolution: Done
    • 3.0.14
    • Affects Version/s: None
    • Component/s: None

      Hi.
      I have user class. and User has one profile.
      Profile has enable attribute.

      If I do next:
      user.profile.enable = true;
      user.save!

      It work ok and new value (true) stored in DB successful.

      But if I have any :after_initialize callback.
      Then after save field "enable" leaves in false state.

      Why?
      Is this a bug or a feature?

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

              Created:
              Updated:
              Resolved: