- Extended by:
- Included in:
- , , , , , , , , , , ,
- Defined in:
Helper methods for polymorphic annotators.
Extends annotators so that global_id strings can be used as attributes referencing the polymorphic object.
include Shared::PolymorphicAnnotator polymorphic_annotates('belongs_to_name', 'foreign_key')
The foreign_key argument is optional, and only necessary when it can't be derived from the belongs_to_name.
Implementing concerns, for example Shared::Taggable, should push foreign keys, like:
TODO: sometime way down the line revisit this Please DO NOT include the following:
validates :<foo>_object, presence: true validates_presence_of :<foo>_object_type, :<foo>_object_id