Releases: activerecord-hackery/ransack
Ransack 1.6.3 for Rails 3 and 4 (bug fix)
- Fix a regression (#496) caused by ee571fe where passing a multi-parameter attribute (like
date_select
) raisedRuntimeError: can't add a new key into hash during iteration
, and add a regression spec for the issue.
Nate Berkopec, Jon Atack
- Update travis-ci to no longer test Rails 3.1 with Ruby 2.2 and speed up the test matrix.
- Refactor Nodes::Condition.
Jon Atack
Ransack 1.6.2 for Rails 3 and 4 (bug fix)
- Fix a regression (#494) where passing an array of routes to
search_form_for
no longer worked.
Daniel Rikowski
- Add a failing/passing spec to catch the issue in the future.
Jon Atack
Ransack 1.6.1 for Rails 3 and 4 (bug fix)
- Fix a regression with using
in
predicates caused by PR #488 and add a test. - README improvements to clarify
sort_link
syntax with associations and Ransack#search vs #ransack. - Default the Gemfile to Rails 4-2-stable.
Jon Atack
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
Ransack 1.5.1 for Rails 3, 4.0, 4.1 and 4.2
Fixed
- Fix a regression caused by incorrect string constants in
context.rb
.
Kazuhiro Nishiyama
Added
- Add base specs for search on fields with
_start
and_end
.
Jon Atack
- Add a failing spec for detecting attribute fields containing
_and_
that needs to be fixed. Attribute names containing_and_
and_or_
are still not parsed/detected correctly.
Jon Atack
Changed
- Remove duplicate code in
spec/support/schema.rb
.
Jon Atack
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
Ransack 1.4.1 for Rails 3, 4.0, 4.1 and 4.2
Ransack version 1.4.1 - September 23, 2014
Fix README so the documentation can be properly parsed by RubyGems.
Ransack 1.4.0 for Rails 3, 4.0, 4.1 and 4.2
Ransack version 1.4.0 - September 23, 2014
Added
- Add support for Rails 4.2.0! Let us know if you encounter any issues.
Xiang Li
Pedro Chambino
- Add
ro.yml
Romanian translation file.
Andreas Philippi
- Add new documentation in the README explaining how to group queries by
OR
instead of the defaultAND
using them: 'or'
combinator. - Add new documentation in the README and in the source code comments
explaining in detail how to handle whitelisting/authorization of
attributes, associations, sorts and scopes. - Add new documentation in the README explaining in more detail how to use
scopes for searching with Ransack. - Begin a CHANGELOG.
Jon Atack
Fixed
- Fix singular/plural Active Record attribute translations.
Andreas Philippi
- Fix the params hash being modified by
Search.new
and the Ransack scope.
Daniel Rikowski
- Apply default scope conditions for association joins (fix for Rails 3).
Avoid selecting records from joins that would normally be filtered out
if they were selected from the base table. Only applies to Rails 3, as
this issue was fixed in Rails 4.
Andrew Vit
- Fix incoherent code examples in the README Associations section that
sometimes used@q
and other times@search
.
Jon Atack
Changed
- Refactor Ransack::Translate.
- Rewrite much of the Ransack README documentation, including the
Associations section code examples and the Authorizations section detailing
how to whitelist attributes, associations, sorts and scopes.
Jon Atack
Ransack release 1.3.0 for Rails 3, 4, and 4.1
Additions since Ransack version 1.2.3:
- search scopes by popular demand
- JOINS merging
- OR grouping on base search
- authorizations for attributes, associations and scopes
- improved boolean predicates’ handling of false values
- allow configuring to raise on or ignore unknown search conditions
- allow passing blank values to search without crash
- wildcard escaping compatibility for SQL Server databases
- various I18n translations