Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #My model class looks like this:
- class Cache
- include DataMapper::Resource
- property :id, Serial
- property :key, String
- property :data, Text, :lazy => false
- property :expires_at, DateTime
- end
- #I can't explain this output:
- irb(main):002:0> c=Cache.first
- => #<Cache id=1 key="a" data="b" expires_at=nil>
- irb(main):003:0> c.data="c"
- => "c"
- irb(main):004:0> c.save
- TypeError: can't convert String into Array
- from /usr/local/lib/ruby/gems/1.8/gems/dm-core-0.9.11/lib/dm-core/model.rb:394:in `zip'
- from /usr/local/lib/ruby/gems/1.8/gems/dm-core-0.9.11/lib/dm-core/model.rb:394:in `to_query'
- from /usr/local/lib/ruby/gems/1.8/gems/dm-core-0.9.11/lib/dm-core/resource.rb:543:in `to_query'
- from /usr/local/lib/ruby/gems/1.8/gems/dm-core-0.9.11/lib/dm-core/resource.rb:603:in `hookable__update_nan_before_advised'
- from /usr/local/lib/ruby/gems/1.8/gems/extlib-0.9.12/lib/extlib/hook.rb:299:in `update'
- from /usr/local/lib/ruby/gems/1.8/gems/extlib-0.9.12/lib/extlib/hook.rb:297:in `catch'
- from /usr/local/lib/ruby/gems/1.8/gems/extlib-0.9.12/lib/extlib/hook.rb:297:in `update'
- from /usr/local/lib/ruby/gems/1.8/gems/dm-core-0.9.11/lib/dm-core/resource.rb:295:in `hookable__save_nan_before_advised'
- from /usr/local/lib/ruby/gems/1.8/gems/extlib-0.9.12/lib/extlib/hook.rb:299:in `save'
- from /usr/local/lib/ruby/gems/1.8/gems/extlib-0.9.12/lib/extlib/hook.rb:297:in `catch'
- from /usr/local/lib/ruby/gems/1.8/gems/extlib-0.9.12/lib/extlib/hook.rb:297:in `save'
- from (irb):4
- irb(main):005:0>
Add Comment
Please, Sign In to add comment