Merge pull request #519 from sineed/ransacker-arguments-changelog
Update CHANGELOG [ci skip]
This commit is contained in:
commit
c2b316ca0a
|
@ -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
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue