scopie 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8624fb23637f827341df103cd643fdb673b72243
4
- data.tar.gz: 2d5ee0f01a32c144a1cbe999953d014a9c284181
3
+ metadata.gz: d1ebe6b17acdf364b2820512fe40325559b16c85
4
+ data.tar.gz: 927b2405f555c1ec618f898f5930700422a7d452
5
5
  SHA512:
6
- metadata.gz: 4c68743f9a944c1ca51ee5d84aafa5b6da7468cab63560a9e0956f6cb91df2687c721bfedf73ebde4cd4c2bad3a35083299cc31ea1920e4585c19c143ae8fbe0
7
- data.tar.gz: e9c308c5a4646ec94437587dd97063ec6d8b512ab709728da6bd40dbacff63185d350abbbb335d5528d9d6ab556dedaf65f3735d524f065b1edc00abae9c46dd
6
+ metadata.gz: a5ef61c580ab44edd6755cad605bd90a5ab2440a4285f0e26a7690dc722371f16533b2931bdf2be244ff466a6c9d080f36fff6e9db881940c8989ecde4bdd9e3
7
+ data.tar.gz: 57fab097cf1d78fc71b4e00f5b098ab4ddd4658a51a59fe6c19976c349a2bf7f1c28876afc1368d49a91d4c12222021c61c4fa6be5f8335c29fff7695c9b9bcb
data/README.md CHANGED
@@ -143,6 +143,8 @@ Scopie supports several options:
143
143
 
144
144
  * `:allow_blank` - Blank values are not sent to scopes by default. Set to true to overwrite.
145
145
 
146
+ * `:ignore_blank` - Set to true to not apply the scope if blank value is given.
147
+
146
148
  * `:default` - Default value for the scope. Whenever supplied the scope is always called.
147
149
 
148
150
  ## Thanks
@@ -118,7 +118,7 @@ class Scopie::Base
118
118
  return false unless method_applicable?(method, options)
119
119
  return false unless value.given?
120
120
 
121
- true
121
+ value.present? || !options[:ignore_blank]
122
122
  end
123
123
 
124
124
  def reduced_hash(hash, options)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Scopie
4
- VERSION = '1.1.1'.freeze
4
+ VERSION = '1.1.2'.freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scopie
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yury Kotov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-28 00:00:00.000000000 Z
11
+ date: 2016-07-29 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Minimal mapping of incoming parameters to named scopes in your resources
14
14
  through OO design and pure Ruby classes