namespaces - Rails: Namespaced Class Method Referring to Wrong Class -
i have 2 models, 1 of namespaced:
group::vote
the other of not:
vote
the namespaced model has class method:
def self.get_user_value(voteable) group::vote.where(:user_id => user.current.id, :voteable_type => voteable.class.name, :voteable_id => voteable.id).first.value end
strangely, when call method so:
group::vote.get_user_value(item)
it gets sent named class method in vote
model. doing wrong or encountering sort of hopeless bug?
Comments
Post a Comment