has_scope 0.8.1 → 0.8.2

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
  SHA256:
3
- metadata.gz: abf0ad461389302c6eef573bc313b2f0753a7dfaa02c23fdf685acce47be111c
4
- data.tar.gz: 79209897cf738ba373be55f2b9fe4543d15880ae466c9a577e23cc1abb06ee3d
3
+ metadata.gz: 9d8bb7a042f13833e2cba867d438e10c9b1b9555ff30d53758a172afa1ae1fc5
4
+ data.tar.gz: 482aa7b28c64ddaa012484b739ba8cc48a45db76bd3025cc38c338e61e41747f
5
5
  SHA512:
6
- metadata.gz: 04a17d0ea9ee72e18ad98fa79c9d4e3a856219673fe066d1326df8b12af29a22f80282f0ec4cb8de9e25653d5f1179137fa4a8475d5fd8bf247ff12f3ab8c20e
7
- data.tar.gz: 87978f08fed8aec6fe006b0d9faee4704b831a11b8b61b1c1211537965d4cd59a85784229d0e3260c49bd7f1313591ba48ac2feb0580417cb69ca1c60d435ad4
6
+ metadata.gz: 850f88a22e0133f0659a088c06c2a047e8be951d6b0bda70f0de36c149002b9a5b3390134a2d0dc5b9fb64866c6fd4bdc5c1e30d4fdea020b9e6494fb5cc0453
7
+ data.tar.gz: 82964c1b89c8d8e8f0356edf1733eba4f9e2cb703a9b600188884cf9dfb5043162bf0b55a77f4113222dbc6fb130a65347f6c2c06eab8b70553208a86b845018
data/MIT-LICENSE CHANGED
@@ -1,4 +1,5 @@
1
- Copyright 2009-2017 Plataforma Tecnologia. http://blog.plataformatec.com.br
1
+ Copyright (c) 2020-2023 Rafael França, Carlos Antônio da Silva
2
+ Copyright (c) 2009-2019 Plataformatec
2
3
 
3
4
  Permission is hereby granted, free of charge, to any person obtaining
4
5
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -297,4 +297,6 @@ and [Rails](https://guides.rubyonrails.org/maintenance_policy.html) maintenance
297
297
 
298
298
  If you discover any bugs or want to drop a line, feel free to create an issue on GitHub.
299
299
 
300
- MIT License. Copyright 2009-2019 Plataformatec. http://blog.plataformatec.com.br
300
+ ## License
301
+
302
+ MIT License. Copyright 2020-2023 Rafael França, Carlos Antônio da Silva. Copyright 2009-2019 Plataformatec.
@@ -0,0 +1,10 @@
1
+ require 'rails/railtie'
2
+
3
+ module HasScope
4
+ class Railtie < Rails::Railtie
5
+ initializer "has_scope.deprecator" do |app|
6
+ app.deprecators[:has_scope] = HasScope.deprecator if app.respond_to?(:deprecators)
7
+ end
8
+ end
9
+ end
10
+
@@ -1,3 +1,3 @@
1
1
  module HasScope
2
- VERSION = "0.8.1"
2
+ VERSION = "0.8.2"
3
3
  end
data/lib/has_scope.rb CHANGED
@@ -11,6 +11,10 @@ module HasScope
11
11
  default: [[ String, Numeric ]],
12
12
  }
13
13
 
14
+ def self.deprecator
15
+ @deprecator ||= ActiveSupport::Deprecation.new("1.0", "HasScope")
16
+ end
17
+
14
18
  def self.included(base)
15
19
  base.class_eval do
16
20
  extend ClassMethods
@@ -201,7 +205,7 @@ module HasScope
201
205
  def applicable?(string_proc_or_symbol, expected) #:nodoc:
202
206
  case string_proc_or_symbol
203
207
  when String
204
- ActiveSupport::Deprecation.warn <<-DEPRECATION.squish
208
+ HasScope.deprecator.warn <<-DEPRECATION.squish
205
209
  [HasScope] Passing a string to determine if the scope should be applied
206
210
  is deprecated and it will be removed in a future version of HasScope.
207
211
  DEPRECATION
@@ -222,6 +226,8 @@ module HasScope
222
226
  end
223
227
  end
224
228
 
229
+ require 'has_scope/railtie' if defined?(Rails)
230
+
225
231
  ActiveSupport.on_load :action_controller do
226
232
  include HasScope
227
233
  helper_method :current_scopes if respond_to?(:helper_method)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: has_scope
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - José Valim
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-04 00:00:00.000000000 Z
11
+ date: 2023-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack
@@ -56,16 +56,16 @@ dependencies:
56
56
  name: mocha
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: 1.0.0
61
+ version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: 1.0.0
68
+ version: '0'
69
69
  description: Maps controller filters to your resource scopes
70
70
  email: opensource@plataformatec.com.br
71
71
  executables: []
@@ -76,6 +76,7 @@ files:
76
76
  - MIT-LICENSE
77
77
  - README.md
78
78
  - lib/has_scope.rb
79
+ - lib/has_scope/railtie.rb
79
80
  - lib/has_scope/version.rb
80
81
  homepage: http://github.com/plataformatec/has_scope
81
82
  licenses:
@@ -101,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
102
  - !ruby/object:Gem::Version
102
103
  version: '0'
103
104
  requirements: []
104
- rubygems_version: 3.4.5
105
+ rubygems_version: 3.4.10
105
106
  signing_key:
106
107
  specification_version: 4
107
108
  summary: Maps controller filters to your resource scopes.