Mongoid v4.0.2 Release Notes

  • 🆕 New Features

    • #3931 Add #find_or_create_by! method to many associations. (Tom Beynon)

    • #3731 Add find_by! method. (Guillermo Iguaran)

    Resolved Issues

    • #3722 Use the right database name when combining #store_in and #with. (Arthur Neves)

    • #3934 Dont apply sort when doing a find_by. (Arthur Neves)

    • #3935 fix multiple fields sorting on contextual memory. (chamnap)

    • #3904 BSON::Document#symbolize_keys should return keys as symbols. (Arthur Neves)

    • #3948 Fix remove_undefined_indexes on rails 4.2, to symbolize right the Document keys. (Adam Wróbel)

    • #3626 Document#to_key, needs to return a ObjectId as String so we can query back using that id. (Arthur Neves)

    • #3888 raise UnknownAttributeError when 'set' is called on non existing field and Mongoid::Attributes::Dynamic is not included in model. (Shweta Kale)

    • #3889 'set' will allow to set value of non existing field when Mongoid::Attributes::Dynamic is included in model. (Shweta Kale)

    • 🛠 #3812 Fixed validation context when saving (Yaroslav Zemlyanuhin)