I would not think that there is a difference when it comes to active recording and data retrieval.
Here are my models
class User < ActiveRecord::Base has_many :shows end class Show < ActiveRecord::Base belongs_to :user end
When I use the rails console, I can do the following and it works.
u = User.find(1) u.shows
He gives me all the shows for this user.
However when i do
u = User.where("username = ?", "percent20") u.shows
I get the same user and relevant information, but not the relationship. The only problem I see is, maybe I'm doing something wrong, because there is some difference between where to find it.
Any help is appreciated.
ruby-on-rails activerecord ruby-on-rails-3
percent20
source share