merge_params 0.4.2 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Changelog.md +5 -0
- data/License +1 -1
- data/lib/merge_params/helpers.rb +2 -2
- data/lib/merge_params/version.rb +1 -1
- data/merge_params.gemspec +1 -1
- metadata +5 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: d43d9cf3df4fb81e7b97db8b9a4881983d93c76fd2a2c62da80afae6209cae95
|
4
|
+
data.tar.gz: b76c110bc2145c68e4f7d7eb33b39c5b2264a84e1dcf96828bb378c6e53d5251
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1630b02c9715804035906a2c29994352f9cdbacfd61c398df1ed2c2afb0672d01fe7f5f442d2a5cda371cd98ae881207dd9126a61aaf0258dd11f93e80e17b2f
|
7
|
+
data.tar.gz: 82c2373090cd74310668114f6ea0b4742d66955d2c329b8c4c4f9377dce402aa377cd608eed8975b0ab2757db744b2ded9b35dc04fa3cc8347d965fb13cdea51
|
data/Changelog.md
CHANGED
@@ -5,6 +5,11 @@ recommendations of [keepachangelog.com](http://keepachangelog.com/).
|
|
5
5
|
|
6
6
|
## (Unreleased)
|
7
7
|
|
8
|
+
## 0.5.0 (2020-08-25)
|
9
|
+
- Change the order of arguments for `add_params` to `add_params(url, query_params_to_add)`.
|
10
|
+
This feels more natural, since you are adding the new query params to the _end_ of the given URL.
|
11
|
+
It is also more consistent with the Rails route helpers, like `something_path(query_params_to_add)`.
|
12
|
+
|
8
13
|
## 0.4.2 (2019-02-10)
|
9
14
|
- Fix `merge_url_for` to not pass on reserved options like only_path (which were only intended for
|
10
15
|
consumption by `url_for`) to `add_params`. It was adding it to the end of the URL, like
|
data/License
CHANGED
data/lib/merge_params/helpers.rb
CHANGED
@@ -104,12 +104,12 @@ module MergeParams::Helpers
|
|
104
104
|
[k, v]
|
105
105
|
end
|
106
106
|
}
|
107
|
-
add_params(
|
107
|
+
add_params(url, query_params_to_add)
|
108
108
|
end
|
109
109
|
|
110
110
|
# Adds params to the query string
|
111
111
|
# (Unlike url_for_merge, which tries to generate a route from the params.)
|
112
|
-
def add_params(
|
112
|
+
def add_params(url = request.fullpath, new_params = {})
|
113
113
|
uri = URI(url)
|
114
114
|
# Allow keys that are currently in query_params to be deleted by setting their value to nil in
|
115
115
|
# new_params (including in nested hashes).
|
data/lib/merge_params/version.rb
CHANGED
data/merge_params.gemspec
CHANGED
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
|
|
31
31
|
spec.add_dependency "actionpack", [">= 4.2", "< 5.3"]
|
32
32
|
spec.add_dependency "facets"
|
33
33
|
|
34
|
-
spec.add_development_dependency "bundler", "~>
|
34
|
+
spec.add_development_dependency "bundler", "~> 2"
|
35
35
|
spec.add_development_dependency "rake", "~> 10.0"
|
36
36
|
spec.add_development_dependency "rspec", "~> 3.0"
|
37
37
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: merge_params
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tyler Rick
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-08-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -70,14 +70,14 @@ dependencies:
|
|
70
70
|
requirements:
|
71
71
|
- - "~>"
|
72
72
|
- !ruby/object:Gem::Version
|
73
|
-
version: '
|
73
|
+
version: '2'
|
74
74
|
type: :development
|
75
75
|
prerelease: false
|
76
76
|
version_requirements: !ruby/object:Gem::Requirement
|
77
77
|
requirements:
|
78
78
|
- - "~>"
|
79
79
|
- !ruby/object:Gem::Version
|
80
|
-
version: '
|
80
|
+
version: '2'
|
81
81
|
- !ruby/object:Gem::Dependency
|
82
82
|
name: rake
|
83
83
|
requirement: !ruby/object:Gem::Requirement
|
@@ -150,8 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
150
150
|
- !ruby/object:Gem::Version
|
151
151
|
version: '0'
|
152
152
|
requirements: []
|
153
|
-
|
154
|
-
rubygems_version: 2.6.14.3
|
153
|
+
rubygems_version: 3.1.2
|
155
154
|
signing_key:
|
156
155
|
specification_version: 4
|
157
156
|
summary: Safely merge params for use with url_for or for the query string
|