Re: [Rails] model issues with ruby on rails 3
On 13 April 2012 06:50, amvis <vgrkrishnan@gmail.com> wrote:
> [snip]
> when i check like this i got the solution
>
> if !@user.business_admins[0].nil?
if !@user.business_admins.empty?
might be a bit cleaner and easier to understand, or
if @user.business_admins.count == 0
Colin
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home