
"property.like" paths are not recognized by assert_valid_conditions
Reported by Postmodern | February 19th, 2011 @ 10:31 PM
I noticed that when combining a String path with the 'like' modifier, it causes assert_valid_conditions to raise an error:
Example code:
https://github.com/postmodern/dm-bug-report/blob/path_like/bug.rb#L...
Steps to reproduce:
$ git clone git://github.com/postmodern/dm-bug-report.git
$ cd dm-bug-report/
$ git fetch
$ git checkout origin/path_like
$ DM_EDGE=true bundle install
$ DM_EDGE=true ./bug.rb
Output:
Works: :name.like
[#<User @name="bob" @id=1>]
Fails: "name.like"
/home/hal/.rvm/gems/ruby-1.9.2-p180/bundler/gems/dm-core-161e744bd485/lib/dm-core/query.rb:861:in `block in assert_valid_conditions': condition "name.like" does not map to a relationship in User (ArgumentError)
from /home/hal/.rvm/gems/ruby-1.9.2-p180/bundler/gems/dm-core-161e744bd485/lib/dm-core/query.rb:853:in `each'
from /home/hal/.rvm/gems/ruby-1.9.2-p180/bundler/gems/dm-core-161e744bd485/lib/dm-core/query.rb:853:in `assert_valid_conditions'
from /home/hal/.rvm/gems/ruby-1.9.2-p180/bundler/gems/dm-core-161e744bd485/lib/dm-core/query.rb:776:in `block in assert_valid_options'
from /home/hal/.rvm/gems/ruby-1.9.2-p180/bundler/gems/dm-core-161e744bd485/lib/dm-core/query.rb:766:in `each'
from /home/hal/.rvm/gems/ruby-1.9.2-p180/bundler/gems/dm-core-161e744bd485/lib/dm-core/query.rb:766:in `assert_valid_options'
from /home/hal/.rvm/gems/ruby-1.9.2-p180/bundler/gems/dm-core-161e744bd485/lib/dm-core/query.rb:363:in `update'
from /home/hal/.rvm/gems/ruby-1.9.2-p180/bundler/gems/dm-core-161e744bd485/lib/dm-core/query.rb:386:in `merge'
from /home/hal/.rvm/gems/ruby-1.9.2-p180/bundler/gems/dm-core-161e744bd485/lib/dm-core/model.rb:752:in `scoped_query'
from /home/hal/.rvm/gems/ruby-1.9.2-p180/bundler/gems/dm-core-161e744bd485/lib/dm-core/model.rb:334:in `all'
from ./bug.rb:88:in `<main>'
Comments and changes to this ticket
-
Postmodern February 19th, 2011 @ 10:41 PM
- Tag changed from string key conditions, like, path, query to assert_valid_conditions, like, path, query
- Assigned user set to Jordan Ritter
-
Postmodern February 19th, 2011 @ 10:43 PM
- Assigned user changed from Jordan Ritter to Dan Kubb (dkubb)
-
Dan Kubb (dkubb) March 7th, 2011 @ 12:06 AM
- State changed from new to resolved
(from [df892fe64693304f5363542503d82a5fbe65e841]) Fixed bug with "property.predicate" not being validated properly
[#1488 state:resolved] https://github.com/datamapper/dm-core/commit/df892fe64693304f536354...
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.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
People watching this ticket
Referenced by
-
1488 "property.like" paths are not recognized by assert_valid_conditions [#1488 state:resolved] https://github.com/datamapper/dm-...