Skip to content

Fluent Models malfunction if given a property named description #588

@gwynne

Description

@gwynne

Due to the CustomStringConvertible conformance provided by AnyModel, the rules of dynamic dispatch through existentials, and the behavior of Mirror, Fluent malfunctions badly if a model tries to provide an optional description property as a database field. There is no warning from the compiler or the framework for this scenario and no indication whatsoever of the underlying cause. Fluent needs to either trigger an assertion as easily as possible for such properties, or - much more preferably - handle them gracefully. (Note: The latter is badly complicated by the fact that it would be a semver-major break to remove the CustomStringConvertible conformance from AnyModel. Look into whether sneaking around the problem using something like the @_implements attribute would work.)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions