has_eav 1.1.1 → 1.1.2
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/VERSION +1 -1
- data/has_eav.gemspec +2 -2
- data/lib/has_eav.rb +2 -1
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.2
|
data/has_eav.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{has_eav}
|
8
|
-
s.version = "1.1.
|
8
|
+
s.version = "1.1.2"
|
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 = %q{2011-
|
12
|
+
s.date = %q{2011-06-01}
|
13
13
|
s.description = %q{Put EAV behaviour on your ActiveRecord models}
|
14
14
|
s.email = %q{hcdm@matchvertise.com}
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/has_eav.rb
CHANGED
@@ -219,10 +219,11 @@ module ActiveRecord
|
|
219
219
|
def cast_eav_value value, attribute # :nodoc:
|
220
220
|
attributes = self.class_eav_attributes.stringify_keys
|
221
221
|
return value unless attributes.keys.include?(attribute)
|
222
|
+
return value if attributes[attribute] == String # no need for casting
|
222
223
|
|
223
224
|
|
224
225
|
begin
|
225
|
-
# for core types [eg:
|
226
|
+
# for core types [eg: Integer '12']
|
226
227
|
eval("#{attributes[attribute]} '#{value}'")
|
227
228
|
|
228
229
|
rescue
|
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:
|
4
|
+
hash: 23
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 1.1.
|
9
|
+
- 2
|
10
|
+
version: 1.1.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Hartog C. de Mik
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-06-01 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|