another thought:
it would be better to include that kind of logic into the registration-
process. that way you dont have to call it every time someone logs in.
something like this:
def register
user = User.new
admins = Group.find_by_name("admin")
if admins.users.size == 0
user.groups << admins
end
end
hard to tell you which way to go. in the end it's YOUR application.
still i hope i could give you some inspiration.
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---