Custom behavior for mounts now works more like ActiveRecord's dirty behavior. Mongoid doesn't deem an attribute as changed unless the new value is different than the original. Given that CarrierWave caches files before save, it's necessary to know that there's a pending change even though the attribute value itself might not reflect that yet. Fixes #23
…some code on our project :-)
… embed_one_fix * coderifous/fix-embeds-one-support: Added support for embeds_one associations. Conflicts: lib/carrierwave/mongoid.rb spec/mongoid_spec.rb
* piotrj/embed_one_fix: Fix for embed_one documents
Mongoid's *_changed? methods actually test the underlying attribute values; whereas, ActiveModel's *_changed? methods guarantees to mark an attribute as changed if the corresponding *_will_change! method was called. The result is that it is difficult to mark a CarrierWave field as changed, because until before_save is called, the file is only in the cache and not yet represented in the attributes hash. This might be related to issue #23
Tests now correlates more closely with Carrierwave 0.5.x
Describe why it does not work and suggest the cascade_callbacks solution along to the existing one of calling save on every embedded file.
…ion, who are looking for carrierwave/orm/mongoid