I've tried in vain to get 0.10RC1 to work with Merb, as I get the
following error reported whenever a model is saved to the database:
(this is done through merb -i on a brand new merb-gen'd app with one
table - parents, with :id and :name. The code is ZIP'd and uploaded to
the Google group)
>> p = Parent.new(:name => "Andy")
=> #<Parent @id=nil @name="Andy">
>> p.save
~ (0.000403) SELECT "id" FROM "parents" WHERE "name" = 'Andy' ORDER
BY "id" LIMIT 1
~ parents.id may not be NULL (code: 19, sql state: , query: INSERT
INTO "parents" ("name") VALUES ('Andy'), uri: sqlite3://
sample_development.db)
DataObjects::IntegrityError: parents.id may not be NULL (code: 19, sql
state: , query: INSERT INTO "parents" ("name") VALUES ('Andy'), uri:
sqlite3://sample_development.db)
from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.10.0/lib/dm-core/
adapters/data_objects_adapter.rb:159:in `execute_non_query'
from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.10.0/lib/dm-core/
adapters/data_objects_adapter.rb:159:in `execute'
from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.10.0/lib/dm-core/
adapters/data_objects_adapter.rb:263:in `with_connection'
from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.10.0/lib/dm-core/
adapters/data_objects_adapter.rb:157:in `execute'
from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.10.0/lib/dm-core/
adapters/data_objects_adapter.rb:53:in `create'
from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.10.0/lib/dm-core/
adapters/data_objects_adapter.rb:32:in `each'
from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.10.0/lib/dm-core/
adapters/data_objects_adapter.rb:32:in `create'
from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.10.0/lib/dm-core/
repository.rb:129:in `create'
from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.10.0/lib/dm-core/
resource.rb:693:in `hookable___create_nan_before_advised'
from /opt/local/lib/ruby/gems/1.8/gems/extlib-0.9.13/lib/extlib/
hook.rb:299:in `_create'
from /opt/local/lib/ruby/gems/1.8/gems/extlib-0.9.13/lib/extlib/
hook.rb:297:in `catch'
from /opt/local/lib/ruby/gems/1.8/gems/extlib-0.9.13/lib/extlib/
hook.rb:297:in `_create'
from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.10.0/lib/dm-core/
resource.rb:604:in `save_self'
from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.10.0/lib/dm-core/
resource.rb:372:in `save!'
from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.10.0/lib/dm-core/
resource.rb:356:in `save'
from /opt/local/lib/ruby/gems/1.8/gems/dm-validations-0.10.0/lib/dm-
validations.rb:56:in `save'
from (irb):2
from :0>>
This is a very odd error, IMO, as it is complaining about the
IntegrityError for the database ID on an INSERT statement, which
doesn't make a great deal of sense to me. I saw a link to some steps
to get a merb app ready for 0.10RC1 -
http://sick.snusnu.info/2009/06/03/migrating-to-datamapper-0100
- that implies there are changes required, presumably in merb-
datamapper, but I'm not sure what. Is there going to be a revised merb-
datamapper gem out too to support 0.10RC1?
Thanks in advance for any help,
Andy
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"DataMapper" 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/datamapper?hl=en
-~----------~----~----~----~------~----~------~--~---