Skip to content

Bowtie gives an error when trying to edit a model without an id field #9

Open
coryalder opened this Issue Mar 9, 2014 · 0 comments

1 participant

@coryalder

Where this is likely to come up, is if you have a join table.
e.g.

class PostUsers
  include DataMapper::Resource

  belongs_to :post, :key => true
  belongs_to :user, :key => true
end

class Post
  include DataMapper::Resource
  property :id, Serial
  has n, :users, :through => Resource
end

class User
  include DataMapper::Resource
  property :id, Serial
  has n, :posts, :through => Resource
end

Something like that will give this error when accessed via bowtie:

+options[:order]+ entry :id does not map to a property in PostUsers

Not a huge deal, as I was able to add an id property to "PostUsers", but I thought I should document this issue somewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.