Class: TagFollowing

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/tag_following.rb

Class Method Summary collapse

Class Method Details

.user_is_following?(user, tagname) ⇒ Boolean


7
8
9
# File 'app/models/tag_following.rb', line 7

def self.user_is_following?(user, tagname)
  tagname.nil? ? false : joins(:tag).where(:tags => {:name => tagname.downcase}).where(:user_id => user.id).exists?
end