activeupdate 0.0.2 → 0.0.3
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/activeupdate.rb +4 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6be1c8a896db720ca9beb661319327cfd0cc99b6
|
4
|
+
data.tar.gz: f05533ea6f94fc0fda92b06ca6feae84f2ee06ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b7427b1ebbb3dad9161cce9da815b87a5a1a535f420651ae2c09b8ea689d55ab94d2683f74d7a1ea25f677730a95ad1c285ee3ca67d68ad42b7c1f5636c7a43
|
7
|
+
data.tar.gz: 0b450a06665cf9d5c6f6e2796bd3b579a76d9a9297002b4df79b608e10652e3a2b8c5108a0a211a9fd87da97106bbd2e6be731a94c5509c36c4c0744c858b728
|
data/lib/activeupdate.rb
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
module ActiveRecordExtension
|
2
|
-
|
3
2
|
extend ActiveSupport::Concern
|
4
3
|
|
5
|
-
# add your static(class) methods here
|
6
4
|
module ClassMethods
|
7
5
|
|
6
|
+
# Updates an object (or multiple objects) and saves it to the database. The resulting object is returned whether the object was saved successfully to the database or not.
|
7
|
+
#
|
8
|
+
# @param resources_hash [Hash], a hash of resources, { '0' => { 'id' => 1, 'attribute' => 'test' }, '1' => { 'id' => 2, 'attribute' => 'cheese' } }
|
9
|
+
# @return [Object], the object.
|
8
10
|
def update!(resources_hash = nil)
|
9
11
|
return self unless resources_hash
|
10
12
|
|
@@ -46,5 +48,4 @@ module ActiveRecordExtension
|
|
46
48
|
end
|
47
49
|
end
|
48
50
|
|
49
|
-
# include the extension
|
50
51
|
ActiveRecord::Base.send(:include, ActiveRecordExtension)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activeupdate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew H. Carpenter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-13 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: drewwcarpenter@gmail.com
|