#1488 ✓resolved
Postmodern

"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

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