custom_fields 1.0.0.beta.5 → 1.0.0.beta.6
Sign up to get free protection for your applications and to get access to all the features.
data/lib/custom_fields/field.rb
CHANGED
@@ -18,7 +18,7 @@ module CustomFields
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def #{self.safe_alias}=(value)
|
21
|
-
if value.is_a?(::String)
|
21
|
+
if value.is_a?(::String) && !value.blank?
|
22
22
|
date = ::Date._strptime(value, I18n.t('date.formats.default'))
|
23
23
|
value = ::Date.new(date[:year], date[:mon], date[:mday])
|
24
24
|
end
|
@@ -14,11 +14,6 @@ module CustomFields
|
|
14
14
|
alias :#{self.safe_alias} :#{self._name}
|
15
15
|
alias :#{self.safe_alias}= :#{self._name}=
|
16
16
|
EOF
|
17
|
-
|
18
|
-
# add validation if required field
|
19
|
-
if self.required?
|
20
|
-
klass.validates_presence_of self.safe_alias.to_sym
|
21
|
-
end
|
22
17
|
end
|
23
18
|
|
24
19
|
end
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: custom_fields
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 62196367
|
5
5
|
prerelease: 6
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
9
|
- 0
|
10
10
|
- beta
|
11
|
-
-
|
12
|
-
version: 1.0.0.beta.
|
11
|
+
- 6
|
12
|
+
version: 1.0.0.beta.6
|
13
13
|
platform: ruby
|
14
14
|
authors:
|
15
15
|
- Didier Lafforgue
|
@@ -17,7 +17,7 @@ autorequire:
|
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
19
|
|
20
|
-
date: 2011-03-
|
20
|
+
date: 2011-03-08 00:00:00 +01:00
|
21
21
|
default_executable:
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|