lib/philtre/predicate_splitter.rb in philtre-0.1.0 vs lib/philtre/predicate_splitter.rb in philtre-0.1.1
- old
+ new
@@ -15,10 +15,10 @@
attr_reader :key, :value
# split suffix from the key and store the two values as name and op
# return truthy if successful
def split_key( suffix )
- rv = @key =~ /(.*?)_?(#{suffix})$/
+ rv = @key =~ /\A(?:(.*?)_)?(#{suffix})\z/
@field, @op = $1, $2
rv
end
alias_method :===, :split_key