url_params_manager 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/README.md +5 -1
- data/lib/url_params_manager/service.rb +5 -2
- data/lib/url_params_manager/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5de8109a634df819168a3cb80180e7947365dc0
|
4
|
+
data.tar.gz: 8282374457e43e3983f26e565f1134aca214fa5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e5b8509ffbabd03ec17e64beb4e72e7d0ab061b6d2e6c8491f84a9e7c3ae9209657ed6d87b359d20ec3546ded422f4d0ac4c9ca2b90146c07f435f335312fcf
|
7
|
+
data.tar.gz: 2e39bfa024b81b024215e582a305f384a08ae821fecc909d4bb8f88f61d1c1886ba1b8663550acf77e7f769e4406c1ba4251f20a4f634e0f320bdffd009e8cb2
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -205,7 +205,7 @@ Important observations:
|
|
205
205
|
- the position-defined params hash is **ordered**. The position will be determined by the order of the keys of the config hash.
|
206
206
|
- all position defined param needs a **placeholder**. This will be:
|
207
207
|
- ignored when translating from url to filter
|
208
|
-
- added to the url in its place if a posterior param is present, so we can respect the position order.
|
208
|
+
- added to the url in its place if a posterior param is present (or if `force_placeholder` option is passed as true), so we can respect the position order.
|
209
209
|
- when the param has multiple values, instead of adding them in separate parts, we'll concatenate them using a separator:
|
210
210
|
- it can be passed as `multiple_separator` option
|
211
211
|
- if not passed, it will use a default separator `--`.
|
@@ -292,6 +292,10 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
292
292
|
|
293
293
|
## Changeset
|
294
294
|
|
295
|
+
### v.0.6.0
|
296
|
+
|
297
|
+
- added `force_placeholder` option to `position_defined_url_params`.
|
298
|
+
|
295
299
|
### v.0.5.0
|
296
300
|
|
297
301
|
- added `filter_params_pretreatment` option.
|
@@ -89,8 +89,11 @@ module UrlParamsManager
|
|
89
89
|
# converting into string
|
90
90
|
filters_uri_part = generate_uri_part sorted_uri_args
|
91
91
|
|
92
|
+
# remove empty elements
|
93
|
+
present_uri_filters = filters_uri_part.reject &:blank?
|
94
|
+
|
92
95
|
# query string args + filter param for the urlpath helper methods
|
93
|
-
query_string_args.merge filters:
|
96
|
+
query_string_args.merge filters: present_uri_filters.join('/')
|
94
97
|
end
|
95
98
|
|
96
99
|
def add_placeholders(sorted_uri_args)
|
@@ -101,7 +104,7 @@ module UrlParamsManager
|
|
101
104
|
options = position_defined_url_params[key] || {}
|
102
105
|
need_placeholder = need_placeholder || args[key].present?
|
103
106
|
|
104
|
-
if
|
107
|
+
if args[key].blank? && (need_placeholder || options[:force_placeholder])
|
105
108
|
args[key] = options[:placeholder] || DEFAULT_PLACEHOLDER
|
106
109
|
end
|
107
110
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: url_params_manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eduardo Turiño
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2016-03-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -205,7 +205,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
205
205
|
version: '0'
|
206
206
|
requirements: []
|
207
207
|
rubyforge_project:
|
208
|
-
rubygems_version: 2.
|
208
|
+
rubygems_version: 2.5.1
|
209
209
|
signing_key:
|
210
210
|
specification_version: 4
|
211
211
|
summary: Allows SEO Friendly urls for search pages to be built easily. Intended to
|