mimeo 0.0.10 → 0.0.11
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.
- data/README.md +2 -2
- data/lib/mimeo/version.rb +1 -1
- data/lib/mimeo.rb +3 -3
- metadata +2 -2
data/README.md
CHANGED
@@ -36,8 +36,8 @@ If you want to customize the field mapping:
|
|
36
36
|
|
37
37
|
ohm_model <ModelName>,
|
38
38
|
field_map: {
|
39
|
-
|
40
|
-
|
39
|
+
ohm_model_attr1: :active_record_attr1,
|
40
|
+
ohm_model_att2: :active_record_attr2,
|
41
41
|
...
|
42
42
|
}
|
43
43
|
|
data/lib/mimeo/version.rb
CHANGED
data/lib/mimeo.rb
CHANGED
@@ -35,8 +35,7 @@ module Mimeo
|
|
35
35
|
def save_to_redis
|
36
36
|
begin
|
37
37
|
r = ohm_instance
|
38
|
-
populate
|
39
|
-
r.save
|
38
|
+
populate(r).save
|
40
39
|
ensure
|
41
40
|
return true
|
42
41
|
end
|
@@ -48,7 +47,7 @@ module Mimeo
|
|
48
47
|
|
49
48
|
def populate(record)
|
50
49
|
if field_map
|
51
|
-
field_map.each do |
|
50
|
+
field_map.each do |ohm_field, rails_field|
|
52
51
|
val = self.send(rails_field)
|
53
52
|
record.send("#{ohm_field}=", val)
|
54
53
|
end
|
@@ -59,6 +58,7 @@ module Mimeo
|
|
59
58
|
end
|
60
59
|
end
|
61
60
|
record.rails_id = self.id
|
61
|
+
record
|
62
62
|
end
|
63
63
|
end
|
64
64
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mimeo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-09-
|
12
|
+
date: 2012-09-24 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: ActiveRecord extension for saving data to Redis using a given Ohm model.
|
15
15
|
email:
|