Ransack 1.6.0 for Rails 3 and 4 with Active Record and Mongoid
Added
- Add support for using Ransack with
Mongoid 4.0
without associations (PR #407).
Zhomart Mukhamejanov
- Add support and tests for passing stringy booleans for ransackable scopes (PR #460).
Josh Kovach
- Add an sort_link option to not display sort direction arrows (PR #473).
Fred Bergman
- Numerous documentation improvements to the README, Contributing Guide and wiki.
Jon Atack
Fixed
Idean Labib
- Make
search_form_for
's default:as
option respect the custom search key if it has been set (PR #470). Prior to this change, if you set a customsearch_key
option in the Ransack initializer file, you'd have to also pass anas: :whatever
option to all of the search forms. Fixes #92.
Robert Speicher
- Fix sorting on polymorphic associations due to missing downcase (PR #467).
Eugen Neagoe
- Fix Rails 5 / Arel 5 compatibility after the Arel and Active Record API changed.
- Fix and add tests for sort_link
default_order
parsing if the option is set as a string instead of symbol. - Fix and add a test to handle
nil
in options passed to sort_link. - Fix #search method name conflicts in the README.
Jon Atack
Changed
- Refactor and DRY up FormHelper#SortLink. Encapsulate parsing into a Plain Old Ruby Object with few public methods and small, private functional methods. Limit mutations to explicit methods and mutate no ivars.
- Numerous speed improvements by using more specific Ruby methods like:
Hash#each_key
instead ofHash#keys.each
#none?
instead ofselect#empty?
#any?
instead of#select
followed by#any?
#flat_map
instead of#flatten
followed by#map
!include?
instead of#none?
- Replace
string#freeze
instances with top level constants to reduce string allocations in Ruby < 2.1. - Remove unneeded
Ransack::
namespacing on most of the constants. - In enumerable methods, pass a symbol as an argument instead of a block.
- Update Travis-ci for Rails 5.0.0 and 4-2-stable.
- Update the Travis-ci tests and the Gemfile for Ruby 2.2.
- Replace
#search
with#ransack
class methods in the README and wiki code examples. Enabling the#search
alias by default may possibly be deprecated in the next major release (Ransack v.2.0.0) to address #369.
Jon Atack