I am working on a Padrino project that uses Datamapper as the ORM. I have a User class that looks something like this:
class User
include DataMapper::Resource
property :id, Serial
property :username, String,
property :password, String
property :confirmed, Boolean
...<snip>...
end
Now, in my users
controller, I have this snippet of code:
user = User.get(current_user)
var1 = user.username
var2 = user.confirmed
Now, var1
is populated perfectly fine with the contents of the username
property of the model. However, the next line throws the following error:
NoMethodError at /users/blah
undefined method 'confirmed' for User:Class
Looks like ruby is trying to treat the .confirmed
as a method and not a property? It seems to be happening on Boolean
properties, and not String
or Integer
properties.
Is there something I have missed out?