metamaps--metamaps/app/models/metacode.rb
2014-07-27 15:57:35 -04:00

17 lines
No EOL
382 B
Ruby

class Metacode < ActiveRecord::Base
has_many :in_metacode_sets
has_many :metacode_sets, :through => :in_metacode_sets
has_many :topics
def hasSelected(user)
return true if user.settings.metacodes.include? self.id.to_s
return false
end
def inMetacodeSet(metacode_set)
return true if self.metacode_sets.include? metacode_set
return false
end
end