diff options
| author | Xinhui | 2017-04-12 12:36:22 +0200 |
|---|---|---|
| committer | Xinhui | 2017-04-12 12:36:32 +0200 |
| commit | d7c6d5ce602219b9bfa47686542dd575f1fe2e50 (patch) | |
| tree | b418dd68f2a796b172fda0d90f960606f9fb8865 /config | |
| parent | 0ee6e6c7a85fa72d325ad32d8aa33583919692fd (diff) | |
| download | chouette-core-d7c6d5ce602219b9bfa47686542dd575f1fe2e50.tar.bz2 | |
Remove auto create vjas on jv create if all departure time is set to 00:00
Refs #3101
Diffstat (limited to 'config')
| -rw-r--r-- | config/initializers/ransack.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/config/initializers/ransack.rb b/config/initializers/ransack.rb new file mode 100644 index 000000000..659ee4a79 --- /dev/null +++ b/config/initializers/ransack.rb @@ -0,0 +1,13 @@ +Ransack.configure do |config| + config.add_predicate 'between', + arel_predicate: 'between', + formatter: proc { |v| v.split(' to ') }, + type: :string +end +module Arel + module Predications + def between other + gteq(other[0]).and(lt(other[1])) + end + end +end |
