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

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -