I'm following this tutorial (https://medium.com/@olance/rails-4-user-authentication-with-cequel-and-devise-86e1c9ccbcd0), but I'm having problems with the login. When I receive the following error:
ArgumentError in HomeController#index
Don't know how to cast {"n"=>242893962554067921677178635377202198460} to a UUID
Extracted source (around line #423):
Cql::Uuid.new(value)
else
fail ArgumentError,
"Don't know how to cast #{value.inspect} to a UUID" # Line 423
end
end
The model used by devise is:
class User
include Cequel::Record
devise :database_authenticatable, :registerable
key :id, :uuid, auto => true
column :username, :varchar, :index => true
column :name, :varchar
column :lastname, :varchar
column :email, :varchar, :index => true
column :encrypted_password, :varchar
timestamps
end
If I change the key to a varchar it works, but I wan't to use a UUID, so that the user can change the email or its username.
How can it be corrected?