I have a Phone model nested in the Message model. How to find all messages by a given number, given that the number attribute is inside the Phone model, and not in Message ?
This is what I got now
class Message < ActiveRecord::Base attr_accessible :phone_id belong_to :phone end class Phone < ActiveRecord::Base attr_accessible :phone has_many :messages end
Martin
source share