Rick Armstrong wrote:
>   def user_assigned_course(course_id, user_id)
>     allowed_users = Course.find_by_id(course_id).users
>     for user in allowed_users
>       if user.id == user_id
>         return true
>       end
>     end
>   end
>
>   
And if you want to make your code a little bit cleaner, you can take 
advantage of Ruby's Enumerable#any? method:

def user_assigned_course(course_id, user_id)
    Course.find_by_id(course_id).users.any? { |u| u.id == user_id }
end

Jamey

Confidentiality Notice: This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and/or privileged information. If you are not the intended recipient(s), you are hereby notified that any dissemination, unauthorized review, use, disclosure or distribution of this email and any materials contained in any attachments is prohibited. If you receive this message in error, or are not the intended recipient(s), please immediately notify the sender by email and destroy all copies of the original message, including attachments.