Created
May 29, 2009 00:44
-
-
Save protocarl/119699 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
# built off of next | |
gem 'dm-core', '0.10.0' | |
require 'dm-core' | |
DataMapper.setup(:default, :adapter => :in_memory) | |
module Blog | |
class Post | |
include DataMapper::Resource | |
property :id, Serial | |
has 1, :comment | |
end | |
class Comment | |
include DataMapper::Resource | |
property :id, Serial | |
end | |
end | |
post = Blog::Post.new(:comment => Blog::Comment.new) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/Library/Ruby/Gems/1.8/gems/dm-core-0.10.0/lib/dm-core/associations/many_to_one.rb:130:in `create_reader': compile error (SyntaxError) | |
/Library/Ruby/Gems/1.8/gems/dm-core-0.10.0/lib/dm-core/associations/many_to_one.rb:128: syntax error, unexpected '/', expecting '\n' or ';' | |
def blog/post(query = nil) ... | |
^ | |
/Library/Ruby/Gems/1.8/gems/dm-core-0.10.0/lib/dm-core/associations/many_to_one.rb:130: syntax error, unexpected kEND, expecting $end | |
end # end | |
^ | |
from /Library/Ruby/Gems/1.8/gems/dm-core-0.10.0/lib/dm-core/associations/relationship.rb:338:in `initialize' | |
from /Library/Ruby/Gems/1.8/gems/dm-core-0.10.0/lib/dm-core/associations/many_to_one.rb:107:in `initialize' | |
from /Library/Ruby/Gems/1.8/gems/dm-core-0.10.0/lib/dm-core/associations/relationship.rb:384:in `new' | |
from /Library/Ruby/Gems/1.8/gems/dm-core-0.10.0/lib/dm-core/associations/relationship.rb:384:in `invert' | |
from /Library/Ruby/Gems/1.8/gems/dm-core-0.10.0/lib/dm-core/associations/relationship.rb:301:in `inverse' | |
from /Library/Ruby/Gems/1.8/gems/dm-core-0.10.0/lib/dm-core/associations/relationship.rb:149:in `source_scope' | |
from /Library/Ruby/Gems/1.8/gems/dm-core-0.10.0/lib/dm-core/associations/relationship.rb:157:in `query_for' | |
from /Library/Ruby/Gems/1.8/gems/dm-core-0.10.0/lib/dm-core/associations/one_to_many.rb:42:in `collection_for' | |
... 8 levels... | |
from /Library/Ruby/Gems/1.8/gems/dm-core-0.10.0/lib/dm-core/resource.rb:691:in `initialize' | |
from /Library/Ruby/Gems/1.8/gems/dm-core-0.10.0/lib/dm-core/model.rb:459:in `send' | |
from /Library/Ruby/Gems/1.8/gems/dm-core-0.10.0/lib/dm-core/model.rb:459:in `new' | |
from /Users/carl/Desktop/example.rb:25 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment