Hello everybody...
I''m just getting started with Rails and am stuck. I have two tables, a
user table and a web table.
User < ActiveRecord::Base
has_many :groups
Group < ActiveRecord::Base
belongs_to :user
I''m trying do do a look up to see if a particular user is already part
of a group. The code I have works but it seems there should be an esier
way to do it.
if Group.find(:first, :conditions => {:user_id =>
User.find_by_email(params[:email]), :web_id => session[:web_id]})
Thanks for any help
- Mark
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---