diff options
author | Florian Staudacher <florian_staudacher@yahoo.de> | 2012-05-21 18:35:36 +0400 |
---|---|---|
committer | Florian Staudacher <florian_staudacher@yahoo.de> | 2012-05-21 19:20:04 +0400 |
commit | d815cf5d827119dbe73ec0ffc0448ba0b94eeb05 (patch) | |
tree | 28d20f33200da1d2cbbda38b23a62847fb955ab4 /app/models/tag_following.rb | |
parent | 4819850c9249cac7cf6e99b6472748dd1ffb350f (diff) |
take acts-as-taggable-on gem from git, solve tag case-sensitivity
Diffstat (limited to 'app/models/tag_following.rb')
-rw-r--r-- | app/models/tag_following.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/tag_following.rb b/app/models/tag_following.rb index 8705f185f..b47fbb973 100644 --- a/app/models/tag_following.rb +++ b/app/models/tag_following.rb @@ -3,9 +3,9 @@ class TagFollowing < ActiveRecord::Base belongs_to :tag, :class_name => "ActsAsTaggableOn::Tag" validates_uniqueness_of :tag_id, :scope => :user_id - + def self.user_is_following?(user, tagname) tagname.nil? ? false : joins(:tag).where(:tags => {:name => tagname.downcase}, :user_id => user.id).exists? end - + end |