ocean-dynamo 0.1.11 → 0.1.12
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/lib/ocean-dynamo/persistence.rb +18 -10
- data/lib/ocean-dynamo/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57c8794d00ec0fee8e6c820e773072449d3c6fa8
|
4
|
+
data.tar.gz: 0626caa9717aeccd8d927b6e586a5915b5fd6316
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab7dfe59f45ef9effbb70f4fd9d918578f949f8996eac431197960aa74fd6bdc40d7f16cf0aaca72066c19ebc712d78e01b1ffeb75b39a74637e0920b2cdc02d
|
7
|
+
data.tar.gz: bea89734ed3538b7e00e9d82deef3670f56a92dfb7dabec85022a419d658a98e377a1c392478a6b41047a205218de75b9d80c8dbeabf174fa18424779bee8fd4
|
@@ -60,28 +60,36 @@ module OceanDynamo
|
|
60
60
|
end
|
61
61
|
|
62
62
|
|
63
|
-
def save
|
64
|
-
|
65
|
-
|
66
|
-
|
63
|
+
def save(options={})
|
64
|
+
if perform_validations(options)
|
65
|
+
begin
|
66
|
+
create_or_update
|
67
|
+
rescue RecordInvalid
|
68
|
+
false
|
69
|
+
end
|
70
|
+
else
|
67
71
|
false
|
68
72
|
end
|
69
73
|
end
|
70
74
|
|
71
75
|
|
72
|
-
def save!(
|
73
|
-
|
76
|
+
def save!(options={})
|
77
|
+
if perform_validations(options)
|
78
|
+
create_or_update || raise(RecordNotSaved)
|
79
|
+
else
|
80
|
+
raise RecordInvalid
|
81
|
+
end
|
74
82
|
end
|
75
83
|
|
76
84
|
|
77
|
-
def update_attributes(
|
78
|
-
assign_attributes(
|
85
|
+
def update_attributes(attrs={})
|
86
|
+
assign_attributes(attrs)
|
79
87
|
save
|
80
88
|
end
|
81
89
|
|
82
90
|
|
83
|
-
def update_attributes!(
|
84
|
-
assign_attributes(
|
91
|
+
def update_attributes!(attrs={})
|
92
|
+
assign_attributes(attrs)
|
85
93
|
save!
|
86
94
|
end
|
87
95
|
|
data/lib/ocean-dynamo/version.rb
CHANGED