Class: Tagtical::Tagging

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
ActiveRecord::Backports
Defined in:
lib/tagtical/tagging.rb

Overview

:nodoc:

Instance Method Summary collapse

Methods included from ActiveRecord::Backports

included

Instance Method Details

#<=>(tagging) ⇒ Object



41
42
43
# File 'lib/tagtical/tagging.rb', line 41

def <=>(tagging)
  relevance <=> tagging.relevance
end

#set_tag_target_with_relevance(tag) ⇒ Object



46
47
48
49
50
51
52
53
# File 'lib/tagtical/tagging.rb', line 46

def set_tag_target_with_relevance(tag)
  if tag
    tag = tag.dup
    tag.relevance = relevance
    tag[:tagger_id] = tagger_id
  end
  set_tag_target_without_relevance(tag)
end