I assume you have already worked through the getting started guide and
some tutorials such as railstutorial.org which is free to use online.
Colin
tanizawa
unread,
Jun 30, 2012, 1:37:33 PM6/30/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to rubyonra...@googlegroups.com
I almost use normal ActiveRecord methods.
I use find_by_sql for complected sql.
2012年6月30日土曜日 18時17分48秒 UTC+9 Colin Law:
Colin Law
unread,
Jun 30, 2012, 2:33:47 PM6/30/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to rubyonra...@googlegroups.com
On 30 June 2012 14:37, tanizawa <kazuy...@gmail.com> wrote:
> I almost use normal ActiveRecord methods.
> I use find_by_sql for complected sql.
Why are you joining main.id on sub.id? Normally that would be
considered poor database design. It would be usual to use a has_one
belongs_to relationship, then you could use an ActiveRecord query.
Also your table names should be plural to follow the Rails
conventions.
By the way, please don't top post, it makes it difficult to follow the
thread. Insert your reply inline. Thanks.