Module: Activr::Entity::ModelMixin::ClassMethods
- Defined in:
- lib/activr/entity/model_mixin.rb
Overview
Class methods for the Activr::Entity::ModelMixin mixin
Instance Method Summary collapse
-
#activr_entity(settings) ⇒ Object
Set a custom entity name to use in entity activity feed queries.
-
#activr_entity_feed_actual_name ⇒ Symbol
private
Get entity name to use for activity feed queries.
Instance Method Details
#activr_entity(settings) ⇒ Object
TODO:
Add documentation in README for that
Note:
By default, the entity name is inferred from the model class name
Set a custom entity name to use in entity activity feed queries
81 82 83 |
# File 'lib/activr/entity/model_mixin.rb', line 81 def activr_entity(settings) self.activr_entity_settings = self.activr_entity_settings.merge(settings) end |
#activr_entity_feed_actual_name ⇒ Symbol
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Get entity name to use for activity feed queries
63 64 65 |
# File 'lib/activr/entity/model_mixin.rb', line 63 def activr_entity_feed_actual_name self.activr_entity_settings[:name] || Activr::Utils.kind_for_class(self).to_sym end |