Robert Walker wrote in post #1074687: > class Player > def recommended_courses > Course.where(courses[:handicap].gt(a_player.handicap)) > .and(courses[:handicap].lt(a_player.handicap) > end > end
Just realized after posting that this is a silly example, but should get you on the right track. Should have been something like .... courses[:handicap].gt(a_player.handicap - 5).and(courses[:handicap].lt(a_player.handicap + 5)) Sorry I don't know anything about golf, so that may still sound ridiculous from the perspective of a golf handicap. I hope it at least helps with the programming issue. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.