canonical-rails 0.2.10 → 0.2.11

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
  SHA256:
3
- metadata.gz: 7cc8c724bb2b64e543b2becad527e27a2828bd4113032ecb396f5c8f6425f0e2
4
- data.tar.gz: df6126c3991db70dfea28424bf78b64a8a216e1634e3d8f33f1e9c624e33218a
3
+ metadata.gz: a81685e6294e15e30d48ca8ce1bc15fcba1da4d58ccf16abe967b973e923310f
4
+ data.tar.gz: a9a783ecf48e8bd9824be40f5ac229cb121681aa30ed2859d48e34f47adbb534
5
5
  SHA512:
6
- metadata.gz: dafcabbeea6d18de1a8e50d7402e4169d0e451d8fa47a4bb4b311c7e9f616aa78314725ef2ef6684fe44c7a424525d92f58bbd6f9a99540805ecacc0416ab4da
7
- data.tar.gz: 3ddf2e2e9fd2423c7eb6f2675755d7ea0461233aa13a61289274129124e1e32cc1b6e9470d74911902baeb5ca165493f8125d5fa1f875186d242c46ee4115b65
6
+ metadata.gz: a91cb09a01bac779d159729212b21f12ff1349e2416a7defd810e53304f3be666cdb89bbaf1b95813b7ef29c01d080aa5a09647d751a8d08a617ea3e05c23bef
7
+ data.tar.gz: 0ea17f484eb95061b76f6845e56c81a240132512ddd719d11b2735bf80892f556525782acf09f2d8346c7886213f3176d7399833e437adf667e042abd6e29518
@@ -73,10 +73,8 @@ module CanonicalRails
73
73
  # https://github.com/rack/rack/blob/9939d40a5e23dcb058751d1029b794aa2f551900/test/spec_utils.rb#L222
74
74
  # Rack 1.6.0 has it
75
75
  # https://github.com/rack/rack/blob/65a7104b6b3e9ecd8f33c63a478ab9a33a103507/test/spec_utils.rb#L251
76
-
77
- wl_params = allowed_params
78
-
79
- "?" + Rack::Utils.build_nested_query(convert_numeric_params(wl_params)) if wl_params.present?
76
+ parameters = allowed_params
77
+ "?" + Rack::Utils.build_nested_query(convert_numeric_params(parameters)) if parameters.present?
80
78
  end
81
79
 
82
80
  private
@@ -1,4 +1,5 @@
1
1
  require "canonical-rails/engine"
2
+ require "canonical-rails/deprecation"
2
3
 
3
4
  module CanonicalRails
4
5
 
@@ -23,6 +24,10 @@ module CanonicalRails
23
24
  mattr_accessor :collection_actions
24
25
  @@collection_actions = [:index]
25
26
 
27
+ # @deprecated: use config.allowed_parameters instead
28
+ mattr_accessor :whitelisted_parameters
29
+ @@whitelisted_parameters = []
30
+
26
31
  mattr_accessor :allowed_parameters
27
32
  @@allowed_parameters = []
28
33
 
@@ -34,6 +39,11 @@ module CanonicalRails
34
39
  end
35
40
 
36
41
  def self.sym_allowed_parameters
37
- @@sym_allowed_parameters ||= self.allowed_parameters.map(&:to_sym)
42
+ @@sym_allowed_parameters ||= if self.whitelisted_parameters.empty?
43
+ self.allowed_parameters.map(&:to_sym)
44
+ else
45
+ CanonicalRails::Deprecation.warn('config.whitelisted_parameters is deprecated, please use config.allowed_parameters instead.')
46
+ self.whitelisted_parameters.map(&:to_sym)
47
+ end
38
48
  end
39
49
  end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'active_support/deprecation'
4
+
5
+ module CanonicalRails
6
+ Deprecation = ActiveSupport::Deprecation.new('1.0', 'CanonicalRails')
7
+ end
@@ -1,3 +1,3 @@
1
1
  module CanonicalRails
2
- VERSION = "0.2.10"
2
+ VERSION = "0.2.11"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: canonical-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.10
4
+ version: 0.2.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Ivanov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-11 00:00:00.000000000 Z
11
+ date: 2020-12-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -101,6 +101,7 @@ files:
101
101
  - app/helpers/canonical_rails/tag_helper.rb
102
102
  - config/routes.rb
103
103
  - lib/canonical-rails.rb
104
+ - lib/canonical-rails/deprecation.rb
104
105
  - lib/canonical-rails/engine.rb
105
106
  - lib/canonical-rails/version.rb
106
107
  - lib/generators/canonical_rails/install/install_generator.rb