scopie 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8bee02f08df53a4ada09a728fbba17acddc3edab
4
- data.tar.gz: d57901f26a3758979ac6da8b0e2d16c6752df7c3
3
+ metadata.gz: 8624fb23637f827341df103cd643fdb673b72243
4
+ data.tar.gz: 2d5ee0f01a32c144a1cbe999953d014a9c284181
5
5
  SHA512:
6
- metadata.gz: 4420ad199466801d4af7f85b639c448d97231b2e0d86b4c445930a30a8a2ee8ed2a6c9efc56019cfe36778a33b233aa7f3c04dfdd40f0a0c702605b1a07f2018
7
- data.tar.gz: 19cbd4bb3c08a6e9ea0723424658870ba8060838bb239c2de9f0dd217c0cdd370ace7c2958e56944b3e10637893495213a6ece618b7fb62d936ff75c48e713a7
6
+ metadata.gz: 4c68743f9a944c1ca51ee5d84aafa5b6da7468cab63560a9e0956f6cb91df2687c721bfedf73ebde4cd4c2bad3a35083299cc31ea1920e4585c19c143ae8fbe0
7
+ data.tar.gz: e9c308c5a4646ec94437587dd97063ec6d8b512ab709728da6bd40dbacff63185d350abbbb335d5528d9d6ab556dedaf65f3735d524f065b1edc00abae9c46dd
@@ -57,7 +57,7 @@ class Scopie::Base
57
57
  end
58
58
 
59
59
  def apply_scopes(target, hash, method = nil)
60
- current_scopes(hash, method).each do |scope_name, value|
60
+ current_scopes_values(hash, method).each do |scope_name, value|
61
61
  target = apply_scope(scope_name, target, value, hash)
62
62
  end
63
63
 
@@ -65,6 +65,15 @@ class Scopie::Base
65
65
  end
66
66
 
67
67
  def current_scopes(hash, method = nil)
68
+ hsh = current_scopes_values(hash, method)
69
+ hsh.update(hsh) do |_, value|
70
+ value.coerced
71
+ end
72
+ end
73
+
74
+ private
75
+
76
+ def current_scopes_values(hash, method)
68
77
  scopes = scopes_configuration.map do |scope_name, options|
69
78
  value = scope_value(scope_name, options, hash)
70
79
  next unless scope_applicable?(value, options, method)
@@ -76,8 +85,6 @@ class Scopie::Base
76
85
  scopes.to_h
77
86
  end
78
87
 
79
- private
80
-
81
88
  def apply_scope(scope_name, target, value, hash)
82
89
  result = if respond_to?(scope_name)
83
90
  public_send(scope_name, target, value.coerced, hash)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Scopie
4
- VERSION = '1.1.0'.freeze
4
+ VERSION = '1.1.1'.freeze
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scopie
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yury Kotov