strong_arms 0.2.0 → 0.2.1
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 +4 -4
- data/README.md +2 -8
- data/lib/strong_arms/utilities.rb +4 -1
- data/lib/strong_arms/version.rb +1 -1
- data/rubocop.yml +10 -15
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: abf13ec7439c3395d145329fec3e71771be918952bb27af1560e5cc1c6d89ebb
|
4
|
+
data.tar.gz: 8c0885abccebb8110ad12ecf4e244985e29a2c8da0b36c009bfe6c8b02d445be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aebad69ebd3084eda3b2bba50ff563a569c7b24fc3be53d7503995b935b8fc53b39a12f42fd4a886ff97c855ca3e3cab05f21e133f932735e388e161630c08df
|
7
|
+
data.tar.gz: 9b364805ad03309ea3f2b6191003d67b95e525ab3668ae341872c9eaedffc4e2a8d45c1f0d9fef521352593c1bfd68af408b4ddc19c5eb83b663f2e9c4f5448c
|
data/README.md
CHANGED
@@ -2,13 +2,7 @@
|
|
2
2
|
|
3
3
|
A nested parameters friendly alternative to [strong_parameters](https://github.com/rails/strong_parameters) found in Rails.
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
`permit()` is great for handling a few parameters, but becomes tough to read and prone to user error when describing a deeply nested structure.
|
8
|
-
|
9
|
-
`require()` is great for ensuring top level keys are present, but does not provide a great interface for flagging specific nested parameters.
|
10
|
-
|
11
|
-
Strong Arms provides an interface which makes declaring nested relationships easy, in addition to whitelisting parameters with `permit`, `require` and `ignore`.
|
5
|
+
Strong Arms provides a simple whitelisting interface and tells you when it encounters unexpected params.
|
12
6
|
|
13
7
|
## Installation
|
14
8
|
|
@@ -131,7 +125,7 @@ end
|
|
131
125
|
|
132
126
|
## Nested Parameters
|
133
127
|
|
134
|
-
|
128
|
+
Strong Arms handles nested parameters, by specifying a relationship with `many_nested` or `one_nested` methods.
|
135
129
|
|
136
130
|
This is similar to how Rails handles association declarations with `has_many` and `has_one` methods.
|
137
131
|
|
data/lib/strong_arms/version.rb
CHANGED
data/rubocop.yml
CHANGED
@@ -1,11 +1,6 @@
|
|
1
1
|
AllCops:
|
2
2
|
Exclude:
|
3
3
|
- db/schema.rb
|
4
|
-
- db/migrate/*
|
5
|
-
- Gemfile*
|
6
|
-
- config/*
|
7
|
-
- node_modules/**/*
|
8
|
-
- vendor/**/*
|
9
4
|
|
10
5
|
Naming/AccessorMethodName:
|
11
6
|
Description: Check the naming of accessor methods for get_/set_.
|
@@ -157,7 +152,7 @@ Style/FrozenStringLiteralComment:
|
|
157
152
|
to help transition from Ruby 2.3.0 to Ruby 3.0.
|
158
153
|
Enabled: false
|
159
154
|
|
160
|
-
|
155
|
+
Lint/FlipFlop:
|
161
156
|
Description: 'Checks for flip flops'
|
162
157
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-flip-flops'
|
163
158
|
Enabled: false
|
@@ -314,6 +309,13 @@ Style/RegexpLiteral:
|
|
314
309
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-r'
|
315
310
|
Enabled: false
|
316
311
|
|
312
|
+
Style/Sample:
|
313
|
+
Description: >-
|
314
|
+
Use `sample` instead of `shuffle.first`,
|
315
|
+
`shuffle.last`, and `shuffle[Fixnum]`.
|
316
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code'
|
317
|
+
Enabled: false
|
318
|
+
|
317
319
|
Style/SelfAssignment:
|
318
320
|
Description: >-
|
319
321
|
Checks for places where self-assignment shorthand should have
|
@@ -345,7 +347,7 @@ Style/StringLiterals:
|
|
345
347
|
Description: 'Checks if uses of quotes match the configured preference.'
|
346
348
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-string-literals'
|
347
349
|
EnforcedStyle: double_quotes
|
348
|
-
Enabled:
|
350
|
+
Enabled: true
|
349
351
|
|
350
352
|
Style/TrailingCommaInArguments:
|
351
353
|
Description: 'Checks for trailing comma in argument lists.'
|
@@ -584,13 +586,6 @@ Performance/ReverseEach:
|
|
584
586
|
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code'
|
585
587
|
Enabled: false
|
586
588
|
|
587
|
-
Performance/Sample:
|
588
|
-
Description: >-
|
589
|
-
Use `sample` instead of `shuffle.first`,
|
590
|
-
`shuffle.last`, and `shuffle[Fixnum]`.
|
591
|
-
Reference: 'https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code'
|
592
|
-
Enabled: false
|
593
|
-
|
594
589
|
Performance/Size:
|
595
590
|
Description: >-
|
596
591
|
Use `size` instead of `count` for counting
|
@@ -652,4 +647,4 @@ Rails/TimeZone:
|
|
652
647
|
|
653
648
|
Rails/Validation:
|
654
649
|
Description: 'Use validates :attribute, hash of validations.'
|
655
|
-
Enabled: false
|
650
|
+
Enabled: false
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: strong_arms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mrjonesbot
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -125,7 +125,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
125
125
|
- !ruby/object:Gem::Version
|
126
126
|
version: '0'
|
127
127
|
requirements: []
|
128
|
-
|
128
|
+
rubyforge_project:
|
129
|
+
rubygems_version: 2.7.6.2
|
129
130
|
signing_key:
|
130
131
|
specification_version: 4
|
131
132
|
summary: Strong Parameters alternative for Ruby/Rails applications
|