Skip to content

See and Learn

November 30, 2010

It is interesting how the class of object returned by the dynamic finder changes:


ruby-1.9.1-p378 > Album.find_by_user_id(1).class => Album(id: integer, name: string, user_id: integer, created_at: datetime, updated_at: datetime)

ruby-1.9.1-p378 > Album.find_all_by_user_id(1).class => Array

Advertisements

From → Uncategorized

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: