#994 ✓resolved
Angel N. Sciortino (angelic)

boolean does not work as part of a composite/foreign key in one-to-one

Reported by Angel N. Sciortino (angelic) | July 29th, 2009 @ 04:14 PM | in 0.10.2

Boolean does not work as part of a composite/foreign key in one-to-one. Example:

class ParentModel
  include DataMapper::Resource

  property :integer_key, Integer, :key => true
  property :boolean_key, Boolean,  :key => true
  property :desc, String

  has 1, :child_model, :child_key => [:integer_key, :boolean_key]
end

class ChildModel
  include DataMapper::Resource

  property :integer_key, Integer, :key => true
  property :other_integer_key, Integer, :key => true
  property :boolean_key, Boolean,  :key => true
  property :desc, String

  belongs_to :parent_model, :child_key => [:integer_key, :boolean_key]
end

child.parent_model and parent.child_model will both return nil currently

fixed with spec here: http://github.com/angelic/dm-core/commit/20759819cda24115617322b4a8...

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Referenced by

Pages