Skip to content

Instantly share code, notes, and snippets.

@TheNicholasNick
Created July 14, 2009 08:49
Show Gist options
  • Save TheNicholasNick/146848 to your computer and use it in GitHub Desktop.
Save TheNicholasNick/146848 to your computer and use it in GitHub Desktop.
module Znq
module Dm;end
end
class Znq::Dm::DealGroup
include DataMapper::Resource
property :id , Serial
has n, :deals, :through => Resource, :class_name => "Znq::Dm::Deal", :child_key => [:deal_id]
end
class Znq::Dm::Deal
include DataMapper::Resource
property :id , Serial
has n, :deal_groups, :through => Resource, :class_name => "Znq::Dm::DealGroup", :child_key => [:deal_group_id]
end
norr@host / [sinatra*] $ bin/thin start -p 3325 -R config.ru
./bin/common.rb:7: warning: already initialized constant BUNDLED_SPECS
./bin/common.rb:8: warning: already initialized constant MAIN_INDEX
./bin/common.rb:9: warning: already initialized constant FALLBACK_INDEX
/znq/gems/gems/dm-core-0.9.11/lib/dm-core/associations/relationship.rb:66:in `parent_model': Cannot find the parent_model ZnqDmDealGroup for ZnqDmDealZnqDmDealGroup (NameError)
from /znq/gems/gems/dm-core-0.9.11/lib/dm-core/associations/relationship.rb:50:in `parent_key'
from /znq/gems/gems/dm-core-0.9.11/lib/dm-core/associations/relationship.rb:18:in `child_key'
from /znq/gems/gems/dm-core-0.9.11/lib/dm-core/repository.rb:44:in `scope'
from /znq/gems/gems/dm-core-0.9.11/lib/dm-core/associations/relationship.rb:15:in `child_key'
from /znq/gems/gems/dm-core-0.9.11/lib/dm-core/model.rb:224:in `properties_with_subclasses'
from /znq/gems/gems/dm-core-0.9.11/lib/dm-core/model.rb:224:in `each_value'
from /znq/gems/gems/dm-core-0.9.11/lib/dm-core/model.rb:224:in `properties_with_subclasses'
from /home/norr/ruby/1.8.7-p173/lib/ruby/1.8/set.rb:195:in `each'
from /home/norr/ruby/1.8.7-p173/lib/ruby/1.8/set.rb:195:in `each_key'
from /home/norr/ruby/1.8.7-p173/lib/ruby/1.8/set.rb:195:in `each'
from /znq/gems/gems/dm-core-0.9.11/lib/dm-core/model.rb:223:in `properties_with_subclasses'
from /znq/gems/gems/dm-core-0.9.11/lib/dm-core/adapters/data_objects_adapter.rb:505:in `create_table_statement'
from /znq/gems/gems/dm-core-0.9.11/lib/dm-core/adapters/mysql_adapter.rb:81:in `create_table_statement'
from /znq/gems/gems/dm-core-0.9.11/lib/dm-core/adapters/data_objects_adapter.rb:463:in `create_model_storage'
from /znq/gems/gems/dm-core-0.9.11/lib/dm-core/auto_migrations.rb:88:in `auto_migrate_up!'
from /znq/gems/gems/dm-core-0.9.11/lib/dm-core/model.rb:113:in `repository'
from /znq/gems/gems/dm-core-0.9.11/lib/dm-core.rb:181:in `repository'
from /znq/gems/gems/dm-core-0.9.11/lib/dm-core/repository.rb:44:in `scope'
from /znq/gems/gems/dm-core-0.9.11/lib/dm-core.rb:181:in `repository'
from /znq/gems/gems/dm-core-0.9.11/lib/dm-core/model.rb:113:in `repository'
from /znq/gems/gems/dm-core-0.9.11/lib/dm-core/auto_migrations.rb:87:in `auto_migrate_up!'
from /znq/gems/gems/dm-core-0.9.11/lib/dm-core/auto_migrations.rb:39:in `auto_migrate_up'
from /znq/gems/gems/dm-core-0.9.11/lib/dm-core/auto_migrations.rb:38:in `each'
from /znq/gems/gems/dm-core-0.9.11/lib/dm-core/auto_migrations.rb:38:in `auto_migrate_up'
from /znq/gems/gems/dm-core-0.9.11/lib/dm-core/auto_migrations.rb:13:in `auto_migrate'
from ./lib/znq/znq.rb:58 = ::DataMapper::AutoMigrator.auto_migrate
from /home/norr/ruby/1.8.7-p173/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /home/norr/ruby/1.8.7-p173/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from config.ru:34
from /znq/gems/gems/rack-1.0.0/lib/rack/builder.rb:29:in `instance_eval'
from /znq/gems/gems/rack-1.0.0/lib/rack/builder.rb:29:in `initialize'
from config.ru:1:in `new'
from config.ru:1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment