Skip to content

Commit 49d3b70

Browse files
authored
Merge pull request #896 from activerecord-hackery/documentation
Documentation
2 parents 7f6525e + 854c9d3 commit 49d3b70

File tree

4 files changed

+90
-27
lines changed

4 files changed

+90
-27
lines changed

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,29 @@
11
# Change Log
22

3+
## Version 1.8.8 - 2018-03-16
4+
* Fix multiple database support
5+
PR [#893](https://github.com/activerecord-hackery/ransack/pull/893)
6+
7+
* Updated Dutch translations
8+
PR [#887](https://github.com/activerecord-hackery/ransack/pull/887)
9+
10+
* Fixed no method error 'asc' for Rails 4.2
11+
PR [#885](https://github.com/activerecord-hackery/ransack/pull/885)
12+
13+
14+
## Version 1.8.7 - 2018-02-05
15+
16+
* Rails 5.2 support
17+
PR [#868](https://github.com/activerecord-hackery/ransack/pull/868)
18+
19+
* Lock pg gem to 0.21 to support older releases
20+
21+
* Warnings cleanup
22+
PR [#867](https://github.com/activerecord-hackery/ransack/pull/867)
23+
24+
* Wildcard escaping
25+
PR [#866]
26+
327
## Version 1.8.6 - 2018-01-23
428

529
### Added

CONTRIBUTING.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,15 @@ Here's a quick guide:
7575
$ DB=pg bundle exec rake spec (`DB=postgres` & `DB=postgresql` work too)
7676
$ DB=mysql bundle exec rake spec
7777

78+
For Postgres and MySQL, databases are expected to exist, called 'ransack'. To create use these commands (assuming OS X and Homebrew):
79+
80+
### Postgres
81+
$ createdb ransack
82+
83+
### MySQL
84+
$ mysql -u root
85+
mysql> create database ransack;
86+
7887
To run only the tests in a particular file: `rspec <path/to/filename>`
7988

8089
$ rspec spec/ransack/search_spec.rb

README.md

Lines changed: 56 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,11 @@ instead.
2727
If you're viewing this at
2828
[github.com/activerecord-hackery/ransack](https://github.com/activerecord-hackery/ransack),
2929
you're reading the documentation for the master branch with the latest features.
30-
[View documentation for the last release (1.8.2).](https://github.com/activerecord-hackery/ransack/tree/v1.8.2)
30+
[View documentation for the last release (1.8.8).](https://github.com/activerecord-hackery/ransack/tree/v1.8.8)
3131

3232
## Getting started
3333

34-
Ransack is compatible with Rails 3, 4 and 5 on Ruby 1.9 and later.
35-
JRuby 9 ought to work as well (see
36-
[this](https://github.com/activerecord-hackery/polyamorous/issues/17)).
34+
Ransack is compatible with Rails 4.2 and 5.0, 5.1 and 5.2 on Ruby 2.2 and later.
3735
If you are using Ruby 1.8 or an earlier JRuby and run into compatibility
3836
issues, you can use an earlier version of Ransack, say, up to 1.3.0.
3937

@@ -412,28 +410,60 @@ query parameters in your URLs.
412410

413411
List of all possible predicates
414412

415-
* `*_eq` - equal
416-
* `*_not_eq` - not equal
417-
* `*_matches` - matches with `LIKE`, e.g. `q[email_matches]=%@gmail.com`
418-
* Also: `*_does_not_match`, `*_matches_any`, `*_matches_all`, `*_does_not_match_any`, `*_does_not_match_all`
419-
* `*_lt` - less than
420-
* `*_lteq` - less than or equal
421-
* `*_gt` - greater than
422-
* `*_gteq` - greater than or equal
423-
* `*_present` - not null and not empty, e.g. `q[name_present]=1` (SQL: `col is not null AND col != ''`)
424-
* `*_blank` - is null or empty. (SQL: `col is null OR col = ''`)
425-
* `*_null`, `*_not_null` - is null, is not null
426-
* `*_in` - match any values in array, e.g. `q[name_in][]=Alice&q[name_in][]=Bob`
427-
* `*_not_in` - match none of values in array
428-
* `*_lt_any`, `*_lteq_any`, `*_gt_any`, `*_gteq_any` - Compare to list of values, at least positive. (SQL: `col > value1 OR col > value2`)
429-
* `*_matches_any`, `*_does_not_match_any` - same as above but with `LIKE`
430-
* `*_lt_all`, `*_lteq_all`, `*_gt_all`, `*_gteq_all` - Compare to list of values, all positive. (SQL: `col > value1 AND col > value2`)
431-
* `*_matches_all`, `*_does_not_match_all` - same as above but with `LIKE`
432-
* `*_not_eq_all` - none of values in a set
433-
* `*_start`, `*_not_start`, `*_start_any`, `*_start_all`, `*_not_start_any`, `*_not_start_all` - start with, (SQL: `col LIKE 'value%'`)
434-
* `*_end`, `*_not_end`, `*_end_any`, `*_end_all`, `*_not_end_any`, `*_not_end_all` - end with, (SQL: `col LIKE '%value'`)
435-
* `*_cont`, `*_cont_any`, `*_cont_all`, `*_not_cont`, `*_not_cont_any`, `*_not_cont_all` - contains value, using `LIKE`
436-
* `*_true`, `*_false` - is true and is false
413+
414+
| Predicate | Description | Notes |
415+
| ------------- | ------------- |-------- |
416+
| `*_eq` | equal | |
417+
| `*_not_eq` | not equal | |
418+
| `*_matches` | matches with `LIKE` | e.g. `q[email_matches]=%@gmail.com`|
419+
| `*_does_not_match` | does not match with `LIKE` | |
420+
| `*_matches_any` | Matches any | |
421+
| `*_matches_all` | Matches all | |
422+
| `*_does_not_match_any` | Does not match any | |
423+
| `*_does_not_match_all` | Does not match all | |
424+
| `*_lt` | less than | |
425+
| `*_lteq` | less than or equal | |
426+
| `*_gt` | greater than | |
427+
| `*_gteq` | greater than or equal | |
428+
| `*_present` | not null and not empty | e.g. `q[name_present]=1` (SQL: `col is not null AND col != ''`) |
429+
| `*_blank` | is null or empty. | (SQL: `col is null OR col = ''`) |
430+
| `*_null` | is null | |
431+
| `*_not_null` | is not null | |
432+
| `*_in` | match any values in array | e.g. `q[name_in][]=Alice&q[name_in][]=Bob` |
433+
| `*_not_in` | match none of values in array | |
434+
| `*_lt_any` | Less than any | SQL: `col < value1 OR col < value2` |
435+
| `*_lteq_any` | Less than or equal to any | |
436+
| `*_gt_any` | Greater than any | |
437+
| `*_gteq_any` | Greater than or equal to any | |
438+
| `*_matches_any` | `*_does_not_match_any` | same as above but with `LIKE` |
439+
| `*_lt_all` | Less than all | SQL: `col < value1 AND col < value2` |
440+
| `*_lteq_all` | Less than or equal to all | |
441+
| `*_gt_all` | Greater than all | |
442+
| `*_gteq_all` | Greater than or equal to all | |
443+
| `*_matches_all` | Matches all | same as above but with `LIKE` |
444+
| `*_does_not_match_all` | Does not match all | |
445+
| `*_not_eq_all` | none of values in a set | |
446+
| `*_start` | Starts with | SQL: `col LIKE 'value%'` |
447+
| `*_not_start` | Does not start with | |
448+
| `*_start_any` | Starts with any of | |
449+
| `*_start_all` | Starts with all of | |
450+
| `*_not_start_any` | Does not start with any of | |
451+
| `*_not_start_all` | Does not start with all of | |
452+
| `*_end` | Ends with | SQL: `col LIKE '%value'` |
453+
| `*_not_end` | Does not end with | |
454+
| `*_end_any` | Ends with any of | |
455+
| `*_end_all` | Ends with all of | |
456+
| `*_not_end_any` | | |
457+
| `*_not_end_all` | | |
458+
| `*_cont` | Contains value | uses `LIKE` |
459+
| `*_cont_any` | Contains any of | |
460+
| `*_cont_all` | Contains all of | |
461+
| `*_not_cont` | Does not contain |
462+
| `*_not_cont_any` | Does not contain any of | |
463+
| `*_not_cont_all` | Does not contain all of | |
464+
| `*_true` | is true | |
465+
| `*_false` | is false | |
466+
437467

438468
(See full list: https://github.com/activerecord-hackery/ransack/blob/master/lib/ransack/locale/en.yml#L15 and [wiki](https://github.com/activerecord-hackery/ransack/wiki/Basic-Searching))
439469

lib/ransack/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module Ransack
2-
VERSION = '1.8.7'
2+
VERSION = '1.8.8'
33
end

0 commit comments

Comments
 (0)