Skip to content

Model::Field compact_attributes should not return nils; unset_attributes should be a thing #9

@kornypoet

Description

@kornypoet
  1. compact_attributes does return "nil but set" attributes. This differs from attributes.compact, which is surprising behavior.
  2. unset_attributes should exist, with the current functionality of compact_attributes, and...
  3. unset_attributes should trigger the firing of the defaults, because...
    • otherwise calling or not calling attributes and then compact_attributes give different behavior; this should be addressed by...
  4. attribute_set? should return true for a field with a default.
    • this is somewhat controversial, but if you believe as flip does that an attribute with a default has always had that value, just lazily evaluated then the behavior is correct.

Bug atually filed by flip, so if TD disagrees he may follow up...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions