I have the following mapping (@location_matches represents a standard SQL query`:
@matches = @location_matches.map { |listing|
}.compact
When I go to my view, I can access @matches.username, etc, etc, etc.
However when I add this model method, I lose all access to any of the info!
@matches = @location_matches.map { |listing|
listing.compute_score(current_user)
}.compact
any ideas why? is there a better way to do this? thank ya
mapreturns an array of the results of the block applied, so all you're getting is an array of computed scores. What were you after originally?