ernie/ransack — pull request #205 by t27duck (2013-02-22 16:39:29+00:00)
Title: Add config option to throw error if you search by an unknown condition

Currently, ransack filters out search conditions that are not existent on the model you're using to search.

````
1.9.3p385 :001 > x = Person.ransack(:name_first_eq => "Bob", :foo_eq => "Bar")
=> Ransack::Search], combinator: and>>
1.9.3p385 :002 > x.conditions
=> [Condition ]
````

This pull request adds a configuration option (ignore_unknown_conditions) to have ransack throw and error if it encounters a search condition it doesn't handle. By default, ignore_unknown_conditions is set to true (matches current functionality). Setting it to false will trigger this new feature.

````
1.9.3p385 :001 > x = Person.ransack(:name_first_eq => "Bob", :foo_eq => "Bar")
Ransack::UnknownConditionError: Unknown search condition: foo_eq
````

The two tests I included tests this feature against the default configuration (does not throw an error) and with ignore_unknown_conditions = false (does throw an error).

The rational for this is for people hailing from the searchlogic days. I'd rather have ransack tell me I'm searching on bs conditions than to scratch my head wondering why I'm getting back so many items in my result set because I fat fingered a search term somewhere.