Model def in View State
        Posted  
        
            by 
                tinzawtun
            
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by tinzawtun
        
        
        
        Published on 2012-10-13T03:35:13Z
        Indexed on 
            2012/10/13
            3:36 UTC
        
        
        Read the original article
        Hit count: 188
        
ruby-on-rails
|ruby
In my ruby on rails project in model, I have some of definition.
class PlaySport < ActiveRecord::Base belongs_to :user belongs_to :sport
def self.getLevel end
def self.check_play_sport(cuser_id,sport_id) end
def current_playing_sport end
def all_played_sports end
end
I catch for this relation like this
current_user.play_sports.current_playing_sport
But I get the undefined method error "current_playing_sports"
What is wrong
© Stack Overflow or respective owner