Skip to content

Ransack 1.5.0 for Rails 3, 4.0, 4.1 and 4.2

Compare
Choose a tag to compare
@jonatack jonatack released this 26 Oct 22:28

Added

  • Add support for multiple sort fields and default orders in Ransack sort_link helpers (pull request).

Caleb Land, James u007

  • Add tests for lteq, lt, gteq and gt predicates. They are also tested in Arel, but testing them in Ransack has proven useful to detect issues.

Jon Atack

  • Add tests for unknown attribute names.

Joe Yates

  • Add tests for attribute names containing _or_ and _and_.

Joe Yates, Jon Atack

  • Add tests for attribute names ending with _start and _end.

Jon Atack, Timo Schilling

  • Add tests for start, not_start, end and not_end predicates, with emphasis on cases when attribute names end with _start and _end.

Jon Atack

Fixed

  • Fix a regression where form labels for attributes through a belongs_to association without a translation for the attribute in the locales file would cause a "no implicit conversion of nil into Hash" crash instead of falling back on the attribute name. Added test coverage.

John Dell, Jon Atack, jasdeepgosal

  • Fix the form_helper date_select spec that was failing with Rails 4.2 and master.

Jon Atack

  • Improve attribute_method? parsing for attribute names containing _and_ and _or_. Attributes named like foo_and_bar or foo_or_bar are recognized now instead of running failing checks for foo and bar.

CORRECTION October 28, 2014: this feature is still not working -- to be fixed.

Joe Yates

  • Improve attribute_method? parsing for attribute names ending with a predicate like _start and _end. For instance, a foo_start attribute is now recognized instead of raising a NoMethodError.

Timo Schilling, Jon Atack

Changed

  • Reduce object allocations and memory footprint (with a slight speed gain as well) by extracting commonly used strings into top level constants and replacing calls to #try methods with simple nil checking.

Jon Atack