Module: DataMapper::Tags::SingletonMethods
- Defined in:
- lib/dm-tags/dm_tags.rb
Instance Method Summary (collapse)
Instance Method Details
- (Boolean) taggable?
16 17 18 |
# File 'lib/dm-tags/dm_tags.rb', line 16 def taggable? true end |
- (Object) tagged_with(string, options = {})
Class Methods
6 7 8 9 10 11 12 13 14 |
# File 'lib/dm-tags/dm_tags.rb', line 6 def tagged_with(string, = {}) tag = Tag.first(:name => string) conditions = { 'taggings.tag_id' => tag.kind_of?(Tag) ? tag.id : nil, 'taggings.taggable_type' => self, } conditions['taggings.tag_context'] = .delete(:on) if .key?(:on) all(conditions.update()) end |