mimeo 0.0.14 → 0.0.15
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/lib/mimeo/version.rb +1 -1
- data/lib/mimeo.rb +2 -1
- metadata +1 -1
data/lib/mimeo/version.rb
CHANGED
data/lib/mimeo.rb
CHANGED
@@ -7,6 +7,7 @@ module Mimeo
|
|
7
7
|
|
8
8
|
self.ohm_model_class = model
|
9
9
|
self.field_map = options[:field_map] if options[:field_map]
|
10
|
+
self.if_block = options[:if] if options[:if]
|
10
11
|
|
11
12
|
self.set_callback :create, :after do
|
12
13
|
self.save_to_redis
|
@@ -26,7 +27,7 @@ module Mimeo
|
|
26
27
|
def if_block_is_truthy
|
27
28
|
if if_block
|
28
29
|
if if_block.is_a? String
|
29
|
-
|
30
|
+
instance_eval if_block
|
30
31
|
elsif if_block.is_a? Proc
|
31
32
|
if_block.call
|
32
33
|
end
|