Are you missing :login => true? Which must be on one field. e.g.

   fields do
     name :string, :unique
     email_address :email_address, :unique, :login => true
   end

Tom


On 6 Jan 2009, at 17:38, Gabriele Tassoni wrote:

>
> Hi,
> I wrote a migration to create automatically an admin user on app's
> installation:
>
> class AdminUser < ActiveRecord::Migration
>  def self.up
>    User.create :administrator => true,
>    :name => "admin",
>    :password => "admin",
>    :password_confirmation => "admin",
>    :email_address => "[email protected]"
>  end
>
>  def self.down
>    User.delete_by_name(:admin)
>  end
> end
>
> when I run rake db:migrate, it returns the error in the subject.
>
> Changing the encrypt_password method in /Library/Ruby/Gems/1.8/gems/
> hobo-0.8.5/lib/hobo/user.rb (I'm using Mac OS X Leopard) to (changed
> the login variable in the second line with name):
>
> def encrypt_password
>      return if password.blank?
>      self.salt = Digest::SHA1.hexdigest("--#{Time.now.to_s}--#
> {name}--") if salt.blank?
>      self.crypted_password = encrypt(password)
> end
>
> did the trick, the rake won't throw the exception anymore.
>
> Is this a bug.. or am I missing something? (I'm trying to stay as
> clean as I can, without hacking around... ^_-)
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Hobo 
Users" 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/hobousers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to