examples/complex.rb in search_lingo-1.0.0 vs examples/complex.rb in search_lingo-1.0.1

- old
+ new

@@ -25,14 +25,12 @@ parser SearchLingo::Parsers::DateParser.new Job.table_name, :date parser SearchLingo::Parsers::DateRangeParser.new Job.table_name, :date - parser SearchLingo::Parsers::LTEDateParser.new Job.table_name, + parser SearchLingo::Parsers::OpenDateRangeParser.new Job.table_name, :date, connection: Job.connection - parser SearchLingo::Parsers::GTEDateParser.new Job.table_name, - :date, connection: Job.connection def default_parse(token) [:where, 'jobs.name LIKE ?', "%#{token}%"] end end @@ -42,21 +40,17 @@ parser SearchLingo::Parsers::DateParser.new Receipt.table_name, :check_date parser SearchLingo::Parsers::DateRangeParser.new Receipt.table_name, :check_date - parser SearchLingo::Parsers::LTEDateParser.new Receipt.table_name, + parser SearchLingo::Parsers::OpenDateRangeParser.new Receipt.table_name, :check_date, connection: Receipt.connection - parser SearchLingo::Parsers::GTEDateParser.new Receipt.table_name, - :check_date, connection: Receipt.connection parser SearchLingo::Parsers::DateParser.new Receipt.table_name, :post_date, 'posted' parser SearchLingo::Parsers::DateRangeParser.new Receipt.table_name, :post_date, 'posted' - parser SearchLingo::Parsers::LTEDateParser.new Receipt.table_name, - :post_date, 'posted', connection: Receipt.connection - parser SearchLingo::Parsers::GTEDateParser.new Receipt.table_name, + parser SearchLingo::Parsers::OpenDateRangeParser.new Receipt.table_name, :post_date, 'posted', connection: Receipt.connection parser do |token| token.match /\Aamount: (\d+(?:\.\d+)?)\z/ do |m| [:where, { receipts: { amount: m[1] } }]