[DataMapper] How to specify primary_key, not_null etc in migration

2013-01-18 Thread Anshuman Shukla
I am writing a migration: migration 1, :create_accounts do up do create_table :accounts do :wcd_guid column :wcd_guid, String, :length = 32, :primary_key = true column :id, String, :length = 32, :not_null = true end end down do drop_table :accounts end end it does not make wcd_guid a primary key,

[DataMapper] cannot get property value from User class

2013-01-18 Thread Alex
Hi, I have a problem getting the user’s name property. What am I doing wrong? I’m going insane why it’s not getting the name: NoMethodError at /sican/feed undefined method `name' for #Enumerator: User:find(sican) Here’s the get method (commented out are some other alternatives that I’ve

[DataMapper] Re: cannot get property value from User class

2013-01-18 Thread Abe Voelker
Give this a try: get '/:nickname/feed' do user = User.first(:nickname = params[:nickname]) if user @user_name = user.name else not_found 'unknown user' end end On Friday, January 18, 2013 12:55:25 PM UTC-6, Alex wrote: Hi, I have a problem getting the user’s name property.

[DataMapper] Re: cannot get property value from User class

2013-01-18 Thread Alex
Thanks Abe, works great! -- You received this message because you are subscribed to the Google Groups DataMapper group. To view this discussion on the web visit https://groups.google.com/d/msg/datamapper/-/05B2ZIb4T3UJ. To post to this group, send email to datamapper@googlegroups.com. To