transformable 0.0.2 → 0.0.4
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/transformable.rb +1 -5
- data/lib/transformable/version.rb +1 -1
- metadata +2 -2
data/lib/transformable.rb
CHANGED
@@ -12,12 +12,8 @@ module Transformable
|
|
12
12
|
|
13
13
|
define_method "#{attr}=" do |value|
|
14
14
|
new_value = yield(value)
|
15
|
-
puts new_value
|
16
15
|
instance_variable_set("@#{attr}", new_value)
|
17
|
-
|
18
|
-
write_attribute(attr, new_value)
|
19
|
-
rescue NoMethodError
|
20
|
-
end
|
16
|
+
write_attribute(attr, new_value) if defined? ActiveRecord and defined? ActiveRecord::Base and is_a? ActiveRecord::Base
|
21
17
|
end
|
22
18
|
end
|
23
19
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: transformable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
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-07-
|
12
|
+
date: 2012-07-31 00:00:00.000000000Z
|
13
13
|
dependencies: []
|
14
14
|
description: Lets you manipulate data as it's being set on an object without a lot
|
15
15
|
of setter method boilerplate
|