Closed psyopcop closed 8 years ago
It would be nice to be able to clone only an association while excluding all parent attributes like so:
pirate.deep_clone only: :treasures
Obviously, this can be done by including the association and then explicitly excluding the parent attributes:
pirate.deep_clone include: :treasures, except: Pirate.column_names
but I expected only to work properly for this.
only
:only is the inverse of :except, it's not meant for specifying inclusions. This would do the same, I guess:
:only
:except
pirate.deep_clone only: [], include: :treasures
That works. Closing.
It would be nice to be able to clone only an association while excluding all parent attributes like so:
Obviously, this can be done by including the association and then explicitly excluding the parent attributes:
but I expected
only
to work properly for this.