activerecord-hackery/ransack — pull request #307 by engineersmnky (2013-11-21 17:52:09+00:00)
Title: Filter ransack attributes with spare_from_ransack

I added a method to the base.rb file called spare_from_ransack allowing specified columns to be dropped from _ransacker.keys without having to overwrite ransackable_attributes in each Model. This method also accepts additional arguments for dropping the primary key field, the time stamp fields and the association key fields such as parent_id. This seemed like a request that keeps re-occurring and I personally hated redefining ransackable_attributes in each model with a long array of columns. This method also allows different attributes to be dropped conditionally since it is part of the Base class and I have implemented it successfully in a couple different applications.