Skip to content

Instantly share code, notes, and snippets.

@lancecarlson
Created January 6, 2010 09:14
Show Gist options
  • Save lancecarlson/270154 to your computer and use it in GitHub Desktop.
Save lancecarlson/270154 to your computer and use it in GitHub Desktop.
Single Table Inheritance
#<DataMapper::Query::Conditions::AndOperation:0x163ffdc @operands=#<Set: {#<DataMapper::Query::Conditions::EqualToComparison @subject=#<DataMapper::Property @model=Person @name=:id> @dumped_value=4b44547c7d209c280e000001 @loaded_value="4b44547c7d209c280e000001">}>>
#<DataMapper::Query::Conditions::AndOperation:0x163463c @operands=#<Set: {#<DataMapper::Query::Conditions::EqualToComparison @subject=#<DataMapper::Property @model=Person @name=:id> @dumped_value=4b44547c7d209c280e000002 @loaded_value="4b44547c7d209c280e000002">}>>
#<DataMapper::Query::Conditions::AndOperation:0x1628cc4 @operands=#<Set: {#<DataMapper::Query::Conditions::EqualToComparison @subject=#<DataMapper::Property @model=Person @name=:id> @dumped_value=4b44547c7d209c280e000003 @loaded_value="4b44547c7d209c280e000003">}>>
#<DataMapper::Query::Conditions::AndOperation:0x161d34c @operands=#<Set: {#<DataMapper::Query::Conditions::EqualToComparison @subject=#<DataMapper::Property @model=Person @name=:id> @dumped_value=4b44547c7d209c280e000004 @loaded_value="4b44547c7d209c280e000004">}>>
- should have a type property that reflects the class
- should parent should return an instance of the child when type is explicitly specified
[]
- should discriminate types during reads (FAILED - 1)
1)
'Single Table Inheritance should discriminate types during reads' FAILED
expected: [#<Father @id="4b44547c7d209c280e00000a" @name=nil @job=nil @type=Father>, #<Father @id="4b44547c7d209c280e00000b" @name=nil @job=nil @type=Father>],
got: [] (using ==)
./spec/sti_spec.rb:50:
Finished in 0.189954 seconds
3 examples, 1 failure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment