Ransack 1.5.0 for Rails 3, 4.0, 4.1 and 4.2
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
andgt
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
andnot_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 likefoo_and_bar
orfoo_or_bar
are recognized now instead of running failing checks forfoo
andbar
.
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, afoo_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