mirror of
https://github.com/activerecord-hackery/ransack.git
synced 2022-11-09 13:47:45 -05:00
Remove custom predicate stuff from the README. Will move it out to a wiki page
This commit is contained in:
parent
2856ac6343
commit
4accc86d49
1 changed files with 3 additions and 19 deletions
22
README.md
22
README.md
|
@ -15,27 +15,11 @@ for Ransack (or MetaSearch, for that matter). Try
|
|||
In your Gemfile:
|
||||
|
||||
gem "ransack" # Last officially released gem
|
||||
# gem "ransack", :git => "git://github.com/ernie/ransack.git" # Track git repo
|
||||
|
||||
If you'd like to add your own custom Ransack predicates:
|
||||
Or if you want to use the bleeding edge:
|
||||
|
||||
gem "ransack", :git => "git://github.com/ernie/ransack.git" # Track git repo
|
||||
|
||||
Ransack.configure do |config|
|
||||
config.add_predicate 'equals_diddly', # Name your predicate
|
||||
# What non-compound ARel predicate will it use? (eq, matches, etc)
|
||||
:arel_predicate => 'eq',
|
||||
# Format incoming values as you see fit. (Default: Don't do formatting)
|
||||
:formatter => proc {|v| "#{v}-diddly"},
|
||||
# Validate a value. An "invalid" value won't be used in a search.
|
||||
# Below is default.
|
||||
:validator => proc {|v| v.present?},
|
||||
# Should compounds be created? Will use the compound (any/all) version
|
||||
# of the arel_predicate to create a corresponding any/all version of
|
||||
# your predicate. (Default: true)
|
||||
:compounds => true,
|
||||
# Force a specific column type for type-casting of supplied values.
|
||||
# (Default: use type from DB column)
|
||||
:type => :string
|
||||
end
|
||||
|
||||
## Usage
|
||||
|
||||
|
|
Loading…
Reference in a new issue