Merge pull request #519 from sineed/ransacker-arguments-changelog

Update CHANGELOG [ci skip]
This commit is contained in:
Jon Atack 2015-03-15 23:12:38 +05:30
commit c2b316ca0a
2 changed files with 6 additions and 1 deletions

View File

@ -2,6 +2,10 @@
## Master (unreleased)
* Add ransacker arguments
([#513](https://github.com/activerecord-hackery/ransack/pull/513))
*Denis Tataurov*, *Jon Atack*
## Version 1.6.3 - 2015-01-21

View File

@ -70,10 +70,11 @@ class Person < ActiveRecord::Base
ransacker :with_passed_arguments, args: [:parent, :ransacker_args] do |parent, args|
min_body, max_body = args
sql = <<-SQL
(SELECT title
(SELECT MAX(articles.title)
FROM articles
WHERE articles.person_id = people.id
AND CHAR_LENGTH(articles.body) BETWEEN #{min_body} AND #{max_body}
GROUP BY articles.person_id
)
SQL
Arel.sql(sql.squish)