bowtie icon indicating copy to clipboard operation
bowtie copied to clipboard

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

Open coryalder opened this issue 10 years ago • 0 comments

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.

coryalder avatar Mar 09 '14 06:03 coryalder