On Monday, January 7, 2013 9:41:33 PM UTC-8, 吴玉宏 wrote:
>
> hi everyone,
>   When I tried to upgrade ruby from 1.8.7 to 1.9 ,I got an issue 
>      NoMethodError:
>        undefined method `<=' for :ip_from:Symbol
> , which is raised from the code
>       filter((:ip_from <= ip) & (:ip_to >= ip)).first.
>
>   All comparison operater >= ,<= ,> ,< used within the filter will raise 
> such similar error.
>
>   All worked well in Ruby 1.8.7, but failed in ruby 1.9 mode.
>
>   So, does anyone know how to write the code for the same functionality 
> filter  in ruby 1.9 mode?
>

This is expected as Ruby 1.9 defines those methods directly on Symbol, and 
Sequel doesn't override methods defined by ruby.

You should switch to using virtual rows:

   filter{(ip_from <= ip) & (ip_to >= ip)}.first.

Thanks,
Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sequel-talk/-/4HCG7KQLVRwJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en.

Reply via email to