grape_has_scope 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/grape_has_scope.rb +5 -5
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5781a062b32b540e375568c51c45fe38c92729df
4
- data.tar.gz: 4e02b3a418cd8d02d5a7417071eef84bb94af337
3
+ metadata.gz: 76ee58631c46df1318d9663e481924f8c1784e83
4
+ data.tar.gz: dbafe90a84dbf979654dea35915466b8d2d28fa3
5
5
  SHA512:
6
- metadata.gz: 4529bd0a950ce35b9e3087fa84f76674384c17d620bc708c7669478149a4a955381944f5bb347cfce821499ea77af6e661bf0cbff819434c6ea3e7361effc74d
7
- data.tar.gz: f0b49285d0bbb10daae6eef30689519572bd124d2b1ceee6f014708d9b18417bf92ab0160e6f0eae16caf92469d66d597ceb21340e5d836fe8de4b21a93fac83
6
+ metadata.gz: bf7fd0af8528122425eda72356c7deaf0aa086215dbd20650b09025306bcb667616c780218137c3813f6a3ace2d70e31c46e8d1fb4f27a0d3c87d179ff850d62
7
+ data.tar.gz: 03f63c8ba58ea3f0eea4924caa120d6b09031902564fb7d5f08727304b89c861e8a2b340b0cc7fa099275cdbf344ac19840fcb63e2d25691989bc399b88ab4cf
@@ -10,7 +10,7 @@ module GrapeHasScope
10
10
 
11
11
  def self.included(base)
12
12
  base.class_eval do
13
- class_attribute :scopes_configuration
13
+ attr_accessor :scopes_configuration
14
14
  end
15
15
  end
16
16
 
@@ -32,11 +32,11 @@ module GrapeHasScope
32
32
  options[:only] = Array(options[:only])
33
33
  options[:except] = Array(options[:except])
34
34
 
35
- self.class.scopes_configuration = (self.class.scopes_configuration || {}).dup
35
+ @scopes_configuration = (@scopes_configuration || {}).dup
36
36
 
37
37
  scopes.each do |scope|
38
- self.class.scopes_configuration[scope] ||= { :as => scope, :type => :default, :block => block }
39
- self.class.scopes_configuration[scope] = self.class.scopes_configuration[scope].merge(options)
38
+ @scopes_configuration[scope] ||= { :as => scope, :type => :default, :block => block }
39
+ @scopes_configuration[scope] = @scopes_configuration[scope].merge(options)
40
40
  end
41
41
  end
42
42
 
@@ -54,7 +54,7 @@ module GrapeHasScope
54
54
  def apply_scopes(target, hash=params)
55
55
  return target unless scopes_configuration
56
56
 
57
- self.class.scopes_configuration.each do |scope, options|
57
+ @scopes_configuration.each do |scope, options|
58
58
  next unless apply_scope_to_action?(options)
59
59
  key = options[:as]
60
60
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grape_has_scope
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kourza Ivan a.k.a. Phobos98