1 Replies - 4418 Views - Last Post: 29 January 2007 - 07:51 PM Rate Topic: -----

#1 theRemix  Icon User is offline

  • D.I.C Regular

Reputation: 15
  • View blog
  • Posts: 440
  • Joined: 19-October 05

if user exists create and update

Posted 29 January 2007 - 04:03 PM

i'm trying to create a user for default (actually in a migration)

can someone help me write this correctly please

# trying to create a user with the login 'anonymous', then setting his user.id to 0
if User.exists?(0) == false
  user = User.create(:attributes => { 'login' => 'anonymous'})
  User.update(user.id, {:id => 0})
end


thanks

This post has been edited by theRemix: 29 January 2007 - 05:12 PM


Is This A Good Question/Topic? 0
  • +

Replies To: if user exists create and update

#2 theRemix  Icon User is offline

  • D.I.C Regular

Reputation: 15
  • View blog
  • Posts: 440
  • Joined: 19-October 05

Re: if user exists create and update

Posted 29 January 2007 - 07:51 PM

nm i got it....
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1