transformable 0.0.2 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
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
- begin
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
@@ -1,3 +1,3 @@
1
1
  module Transformable
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.4"
3
3
  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.2
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-30 00:00:00.000000000Z
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