atomic_json 0.1.0 → 0.1.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 +4 -4
- data/README.md +7 -7
- data/VERSION +1 -1
- data/atomic_json-0.1.0.gem +0 -0
- data/lib/atomic_json/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 178ef309fead5b2e1ba21d6f8d649c6b1ec10096
|
4
|
+
data.tar.gz: d6e8747ee1d775c2ccc908a5ffc05e9d052b5b32
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9709961df141f0826464a285cfe9f03bc6b2f9bc43bcfa33b79e864d63c152e04cec6aa2deb121faadca5c4eb21a61fdea7eacc825e797bad347822b932a25ef
|
7
|
+
data.tar.gz: cba7e1b95790fad2f92b7ee567fdb680294f9ff887c9d424ca02f3a8040de12935efcb8399c6746117818b90884ff6751c0f66084c3b7b7e25e5b7963f6321c4
|
data/README.md
CHANGED
@@ -29,7 +29,7 @@ Only the fields you've specified will be updated
|
|
29
29
|
order.data
|
30
30
|
=> { amount: 50.00, first_name: 'Milkpie', last_name: 'Starlord' }
|
31
31
|
|
32
|
-
order.
|
32
|
+
order.json_update(data: { amount: 10.00 })
|
33
33
|
|
34
34
|
order.data
|
35
35
|
=> { amount: 10.00, first_name: 'Milkpie', last_name: 'Starlord' }
|
@@ -37,7 +37,7 @@ order.data
|
|
37
37
|
|
38
38
|
For the sake of simplicity, AtomicJson mimic the behavior of standard ActiveRecord query methods to update database fields
|
39
39
|
|
40
|
-
###
|
40
|
+
### json_update_columns
|
41
41
|
|
42
42
|
Same as ActiveRecord `update_columns`, this method will make a straight database update
|
43
43
|
- Validations are skipped
|
@@ -45,11 +45,11 @@ Same as ActiveRecord `update_columns`, this method will make a straight database
|
|
45
45
|
- `updated_at` is not updated
|
46
46
|
|
47
47
|
```
|
48
|
-
order.
|
48
|
+
order.json_update_columns(data: { paid: false })
|
49
49
|
=> true
|
50
50
|
```
|
51
51
|
|
52
|
-
###
|
52
|
+
### json_update
|
53
53
|
|
54
54
|
Same as ActiveRecord `update`, this method will
|
55
55
|
- Invoke validations
|
@@ -57,17 +57,17 @@ Same as ActiveRecord `update`, this method will
|
|
57
57
|
- Touch record `updated_at`
|
58
58
|
|
59
59
|
```
|
60
|
-
order.
|
60
|
+
order.json_update(data: { paid: false, product_id: 3772389212 })
|
61
61
|
=> false
|
62
62
|
```
|
63
63
|
|
64
|
-
###
|
64
|
+
### json_update!
|
65
65
|
|
66
66
|
Same as the above `json_update!`, but will raise an `ActiveRecord::RecordInvalid` exception
|
67
67
|
if a custom validation fails
|
68
68
|
|
69
69
|
```
|
70
|
-
order.
|
70
|
+
order.json_update!(data: { paid: false, product_id: 3772389212 })
|
71
71
|
=> ActiveRecord::RecordInvalid Exception: Validation failed: data product_id can't be changed
|
72
72
|
```
|
73
73
|
## Todo's
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
Binary file
|
data/lib/atomic_json/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: atomic_json
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Antoine Macia
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-08-
|
11
|
+
date: 2018-08-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -184,6 +184,7 @@ files:
|
|
184
184
|
- README.md
|
185
185
|
- Rakefile
|
186
186
|
- VERSION
|
187
|
+
- atomic_json-0.1.0.gem
|
187
188
|
- atomic_json.gemspec
|
188
189
|
- bin/console
|
189
190
|
- bin/setup
|