Module: Mongoid::TaggableWithContext

Extended by:
ActiveSupport::Concern
Defined in:
lib/mongoid/taggable_with_context/version.rb,
lib/mongoid/taggable_with_context.rb

Defined Under Namespace

Modules: AggregationStrategy, ClassMethods, GroupBy Classes: AggregationStrategyMissing, InvalidTagsFormat

Constant Summary collapse

VERSION =
'1.1.3'
DEFAULT_FIELD =
:tags
DEFAULT_SEPARATOR =
' '

Instance Method Summary collapse

Instance Method Details

#set_tag_string_for(context, value) ⇒ Object



19
20
21
# File 'lib/mongoid/taggable_with_context.rb', line 19

def set_tag_string_for(context, value)
  self.write_attribute(context, self.class.format_tags_for(context, value))
end

#tag_string_for(context) ⇒ Object



15
16
17
# File 'lib/mongoid/taggable_with_context.rb', line 15

def tag_string_for(context)
  self.read_attribute(context).join(self.class.get_tag_separator_for(context)) rescue ""
end