has_eav 1.1.4 → 1.1.5

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.
Files changed (5) hide show
  1. data/Gemfile.lock +74 -56
  2. data/VERSION +1 -1
  3. data/has_eav.gemspec +2 -2
  4. data/lib/has_eav.rb +5 -10
  5. metadata +25 -25
data/Gemfile.lock CHANGED
@@ -1,76 +1,94 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- abstract (1.0.0)
5
- actionmailer (3.0.3)
6
- actionpack (= 3.0.3)
7
- mail (~> 2.2.9)
8
- actionpack (3.0.3)
9
- activemodel (= 3.0.3)
10
- activesupport (= 3.0.3)
11
- builder (~> 2.1.2)
12
- erubis (~> 2.6.6)
13
- i18n (~> 0.4)
14
- rack (~> 1.2.1)
15
- rack-mount (~> 0.6.13)
16
- rack-test (~> 0.5.6)
17
- tzinfo (~> 0.3.23)
18
- activemodel (3.0.3)
19
- activesupport (= 3.0.3)
20
- builder (~> 2.1.2)
21
- i18n (~> 0.4)
22
- activerecord (3.0.3)
23
- activemodel (= 3.0.3)
24
- activesupport (= 3.0.3)
25
- arel (~> 2.0.2)
26
- tzinfo (~> 0.3.23)
27
- activeresource (3.0.3)
28
- activemodel (= 3.0.3)
29
- activesupport (= 3.0.3)
30
- activesupport (3.0.3)
31
- arel (2.0.6)
32
- builder (2.1.2)
33
- erubis (2.6.6)
34
- abstract (>= 1.0.0)
4
+ actionmailer (3.1.1)
5
+ actionpack (= 3.1.1)
6
+ mail (~> 2.3.0)
7
+ actionpack (3.1.1)
8
+ activemodel (= 3.1.1)
9
+ activesupport (= 3.1.1)
10
+ builder (~> 3.0.0)
11
+ erubis (~> 2.7.0)
12
+ i18n (~> 0.6)
13
+ rack (~> 1.3.2)
14
+ rack-cache (~> 1.1)
15
+ rack-mount (~> 0.8.2)
16
+ rack-test (~> 0.6.1)
17
+ sprockets (~> 2.0.2)
18
+ activemodel (3.1.1)
19
+ activesupport (= 3.1.1)
20
+ builder (~> 3.0.0)
21
+ i18n (~> 0.6)
22
+ activerecord (3.1.1)
23
+ activemodel (= 3.1.1)
24
+ activesupport (= 3.1.1)
25
+ arel (~> 2.2.1)
26
+ tzinfo (~> 0.3.29)
27
+ activeresource (3.1.1)
28
+ activemodel (= 3.1.1)
29
+ activesupport (= 3.1.1)
30
+ activesupport (3.1.1)
31
+ multi_json (~> 1.0)
32
+ arel (2.2.1)
33
+ builder (3.0.0)
34
+ erubis (2.7.0)
35
35
  git (1.2.5)
36
- i18n (0.5.0)
37
- jeweler (1.5.1)
36
+ hike (1.2.1)
37
+ i18n (0.6.0)
38
+ jeweler (1.5.2)
38
39
  bundler (~> 1.0.0)
39
40
  git (>= 1.2.5)
40
41
  rake
41
- mail (2.2.12)
42
- activesupport (>= 2.3.6)
42
+ json (1.6.1)
43
+ mail (2.3.0)
43
44
  i18n (>= 0.4.0)
44
45
  mime-types (~> 1.16)
45
46
  treetop (~> 1.4.8)
46
- mime-types (1.16)
47
- polyglot (0.3.1)
48
- rack (1.2.1)
49
- rack-mount (0.6.13)
47
+ mime-types (1.17.2)
48
+ multi_json (1.0.3)
49
+ polyglot (0.3.3)
50
+ rack (1.3.5)
51
+ rack-cache (1.1)
52
+ rack (>= 0.4)
53
+ rack-mount (0.8.3)
50
54
  rack (>= 1.0.0)
51
- rack-test (0.5.6)
55
+ rack-ssl (1.3.2)
56
+ rack
57
+ rack-test (0.6.1)
52
58
  rack (>= 1.0)
53
- rails (3.0.3)
54
- actionmailer (= 3.0.3)
55
- actionpack (= 3.0.3)
56
- activerecord (= 3.0.3)
57
- activeresource (= 3.0.3)
58
- activesupport (= 3.0.3)
59
+ rails (3.1.1)
60
+ actionmailer (= 3.1.1)
61
+ actionpack (= 3.1.1)
62
+ activerecord (= 3.1.1)
63
+ activeresource (= 3.1.1)
64
+ activesupport (= 3.1.1)
59
65
  bundler (~> 1.0)
60
- railties (= 3.0.3)
61
- railties (3.0.3)
62
- actionpack (= 3.0.3)
63
- activesupport (= 3.0.3)
66
+ railties (= 3.1.1)
67
+ railties (3.1.1)
68
+ actionpack (= 3.1.1)
69
+ activesupport (= 3.1.1)
70
+ rack-ssl (~> 1.3.2)
64
71
  rake (>= 0.8.7)
65
- thor (~> 0.14.4)
66
- rake (0.8.7)
67
- rcov (0.9.9)
72
+ rdoc (~> 3.4)
73
+ thor (~> 0.14.6)
74
+ rake (0.9.2.2)
75
+ rcov (0.9.11)
76
+ rdoc (3.11)
77
+ json (~> 1.4)
68
78
  shoulda (2.11.3)
69
- sqlite3-ruby (1.3.2)
79
+ sprockets (2.0.3)
80
+ hike (~> 1.2)
81
+ rack (~> 1.0)
82
+ tilt (~> 1.1, != 1.3.0)
83
+ sqlite3 (1.3.4)
84
+ sqlite3-ruby (1.3.3)
85
+ sqlite3 (>= 1.3.3)
70
86
  thor (0.14.6)
71
- treetop (1.4.9)
87
+ tilt (1.3.3)
88
+ treetop (1.4.10)
89
+ polyglot
72
90
  polyglot (>= 0.3.1)
73
- tzinfo (0.3.23)
91
+ tzinfo (0.3.31)
74
92
 
75
93
  PLATFORMS
76
94
  ruby
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.4
1
+ 1.1.5
data/has_eav.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "has_eav"
8
- s.version = "1.1.4"
8
+ s.version = "1.1.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Hartog C. de Mik"]
12
- s.date = "2011-09-13"
12
+ s.date = "2011-11-16"
13
13
  s.description = "Put EAV behaviour on your ActiveRecord models"
14
14
  s.email = "hcdm@matchvertise.com"
15
15
  s.extra_rdoc_files = [
data/lib/has_eav.rb CHANGED
@@ -34,7 +34,7 @@ module ActiveRecord
34
34
  klass = opts.delete :through
35
35
  klass = klass.to_s if klass.is_a? Symbol
36
36
  klass = klass.camelize
37
-
37
+
38
38
  raise(
39
39
  "Eav Class cannot be nil. Specify a class using " +
40
40
  "has_eav :through => :class"
@@ -116,13 +116,13 @@ module ActiveRecord
116
116
  return attribute.send(:write_attribute, "value", value)
117
117
 
118
118
  else
119
- @eav_attributes -= [ attribute ]
119
+ self.eav_attributes -= [ attribute ]
120
120
  return attribute.destroy
121
121
 
122
122
  end
123
123
 
124
124
  elsif !value.nil?
125
- @eav_attributes << eav_class.new(
125
+ self.eav_attributes << eav_class.new(
126
126
  :name => attribute_name,
127
127
  :value => "#{value}"
128
128
  )
@@ -221,18 +221,13 @@ module ActiveRecord
221
221
 
222
222
  rescue
223
223
  begin
224
- # for BigDecimal [eg: BigDecimal.new("123.45")]
225
- eval("#{attributes[attribute]}.new('#{value}')")
226
-
224
+ attributes[attribute].new(value)
227
225
  rescue
228
226
  begin
229
- # for date/time classes [eg: Date.parse("2011-03-20")]
230
- eval("#{attributes[attribute]}.parse('#{value}')")
227
+ attributes[attribute].parse(value)
231
228
  rescue
232
- # nothing worked, falling back to whatever the ORM supplied
233
229
  value
234
230
  end
235
-
236
231
  end
237
232
  end
238
233
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: has_eav
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 1
9
- - 4
10
- version: 1.1.4
9
+ - 5
10
+ version: 1.1.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Hartog C. de Mik
@@ -15,10 +15,10 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-09-13 00:00:00 Z
18
+ date: 2011-11-16 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
- requirement: &id001 !ruby/object:Gem::Requirement
21
+ version_requirements: &id001 !ruby/object:Gem::Requirement
22
22
  none: false
23
23
  requirements:
24
24
  - - ~>
@@ -28,12 +28,12 @@ dependencies:
28
28
  - 3
29
29
  - 0
30
30
  version: "3.0"
31
- type: :runtime
32
31
  name: activerecord
33
- version_requirements: *id001
34
32
  prerelease: false
33
+ type: :runtime
34
+ requirement: *id001
35
35
  - !ruby/object:Gem::Dependency
36
- requirement: &id002 !ruby/object:Gem::Requirement
36
+ version_requirements: &id002 !ruby/object:Gem::Requirement
37
37
  none: false
38
38
  requirements:
39
39
  - - ">="
@@ -42,12 +42,12 @@ dependencies:
42
42
  segments:
43
43
  - 0
44
44
  version: "0"
45
- type: :development
46
45
  name: shoulda
47
- version_requirements: *id002
48
46
  prerelease: false
47
+ type: :development
48
+ requirement: *id002
49
49
  - !ruby/object:Gem::Dependency
50
- requirement: &id003 !ruby/object:Gem::Requirement
50
+ version_requirements: &id003 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ~>
@@ -58,12 +58,12 @@ dependencies:
58
58
  - 0
59
59
  - 0
60
60
  version: 1.0.0
61
- type: :development
62
61
  name: bundler
63
- version_requirements: *id003
64
62
  prerelease: false
63
+ type: :development
64
+ requirement: *id003
65
65
  - !ruby/object:Gem::Dependency
66
- requirement: &id004 !ruby/object:Gem::Requirement
66
+ version_requirements: &id004 !ruby/object:Gem::Requirement
67
67
  none: false
68
68
  requirements:
69
69
  - - ~>
@@ -74,12 +74,12 @@ dependencies:
74
74
  - 5
75
75
  - 1
76
76
  version: 1.5.1
77
- type: :development
78
77
  name: jeweler
79
- version_requirements: *id004
80
78
  prerelease: false
79
+ type: :development
80
+ requirement: *id004
81
81
  - !ruby/object:Gem::Dependency
82
- requirement: &id005 !ruby/object:Gem::Requirement
82
+ version_requirements: &id005 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ">="
@@ -88,12 +88,12 @@ dependencies:
88
88
  segments:
89
89
  - 0
90
90
  version: "0"
91
- type: :development
92
91
  name: rcov
93
- version_requirements: *id005
94
92
  prerelease: false
93
+ type: :development
94
+ requirement: *id005
95
95
  - !ruby/object:Gem::Dependency
96
- requirement: &id006 !ruby/object:Gem::Requirement
96
+ version_requirements: &id006 !ruby/object:Gem::Requirement
97
97
  none: false
98
98
  requirements:
99
99
  - - ~>
@@ -103,12 +103,12 @@ dependencies:
103
103
  - 3
104
104
  - 0
105
105
  version: "3.0"
106
- type: :development
107
106
  name: rails
108
- version_requirements: *id006
109
107
  prerelease: false
108
+ type: :development
109
+ requirement: *id006
110
110
  - !ruby/object:Gem::Dependency
111
- requirement: &id007 !ruby/object:Gem::Requirement
111
+ version_requirements: &id007 !ruby/object:Gem::Requirement
112
112
  none: false
113
113
  requirements:
114
114
  - - ">="
@@ -117,10 +117,10 @@ dependencies:
117
117
  segments:
118
118
  - 0
119
119
  version: "0"
120
- type: :development
121
120
  name: sqlite3-ruby
122
- version_requirements: *id007
123
121
  prerelease: false
122
+ type: :development
123
+ requirement: *id007
124
124
  description: Put EAV behaviour on your ActiveRecord models
125
125
  email: hcdm@matchvertise.com
126
126
  executables: []