auto_strip_attributes 1.0.1 → 1.1

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.
@@ -10,8 +10,8 @@ module AutoStripAttributes
10
10
 
11
11
  attributes.each do |attribute|
12
12
  before_validation do |record|
13
- value = record.send(attribute)
14
- #if value.respond_to?('strip')
13
+ #value = record.send(attribute)
14
+ value = record[attribute]
15
15
  if value.respond_to?(:strip)
16
16
  value_stripped = (options[:nullify] && value.blank?) ? nil : value.strip
17
17
 
@@ -1,4 +1,4 @@
1
1
  module AutoStripAttributes
2
2
  #VERSION = "0.0.1"
3
- VERSION = "1.0.1"
3
+ VERSION = "1.1"
4
4
  end
@@ -21,6 +21,11 @@ class MockRecordParent
21
21
  # send("#{key}=", val) # We dont want to call setter again
22
22
  instance_variable_set(:"@#{key}", val)
23
23
  end
24
+
25
+ def [](key)
26
+ instance_variable_get(:"@#{key}")
27
+ end
28
+
24
29
  end
25
30
 
26
31
  describe AutoStripAttributes do
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: auto_strip_attributes
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 13
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
- - 0
9
8
  - 1
10
- version: 1.0.1
9
+ version: "1.1"
11
10
  platform: ruby
12
11
  authors:
13
12
  - Olli Huotari
@@ -15,7 +14,7 @@ autorequire:
15
14
  bindir: bin
16
15
  cert_chain: []
17
16
 
18
- date: 2011-09-21 00:00:00 Z
17
+ date: 2011-10-07 00:00:00 Z
19
18
  dependencies:
20
19
  - !ruby/object:Gem::Dependency
21
20
  name: activerecord