0

using datamapper with ruby. Suppose i have a model called Post:

class Post
  include DataMapper::Resource
  property :id, Serial
  property :name, String, length: 255
  property :category_ids, Object
end

Post.create(name: 'My post', category_ids: [1,2,3])

Post.all(category_ids: [1])
=> []
Post.all(category_ids: [1,2,3])
=> []

It's possible to query over Object properties?

Marcus Mansur
  • 337
  • 1
  • 4
  • 14

1 Answers1

0

Use a Range. Post.all(category_ids: (1..3))

jamesfzhang
  • 4,403
  • 8
  • 32
  • 43