Class: Tag
- Inherits:
-
ActsAsTaggableOn::Tag
- Object
- ActsAsTaggableOn::Tag
- Tag
- Defined in:
- app/models/polymorphic/tag.rb
Instance Method Summary collapse
-
#model_tagging_counts ⇒ Object
Returns a count of taggings per model klass e.g.
-
#no_associated_field_groups ⇒ Object
Don’t allow a tag to be deleted if it is associated with a Field Group.
Instance Method Details
#model_tagging_counts ⇒ Object
Returns a count of taggings per model klass e.g. => 3, “Account” => 1
11 12 13 |
# File 'app/models/polymorphic/tag.rb', line 11 def model_tagging_counts Tagging.where(:tag_id => id).count(:group => :taggable_type) end |
#no_associated_field_groups ⇒ Object
Don’t allow a tag to be deleted if it is associated with a Field Group
5 6 7 |
# File 'app/models/polymorphic/tag.rb', line 5 def no_associated_field_groups FieldGroup.find_all_by_tag_id(self).none? end |