Skip to content

Commit

Permalink
Merge branch 'webform-datetime-fix' of git@charlie-dev.cykod.com:webi…
Browse files Browse the repository at this point in the history
…va-core into development

Conflicts:
	app/controllers/paragraph_renderer.rb
  • Loading branch information
cykod committed May 20, 2010
2 parents fd8e250 + 318be8e commit fceaebe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/webiva_validation_extension.rb
Expand Up @@ -60,7 +60,7 @@ def validates_datetime(*attr_names)
from = Time.parse_datetime(configuration.delete(:from))
to = Time.parse_datetime(configuration.delete(:to))
validates_each(attr_names, configuration) do |record, attr_name, value|
before_cast = record.send("#{attr_name}_before_type_cast")
before_cast = record.is_a?(HashModel) ? record.send(attr_name) : record.send("#{attr_name}_before_type_cast")
next if allow_nil and (before_cast.nil? or before_cast == '')
next if before_cast.is_a?(Time)
next if before_cast.is_a?(String) && before_cast =~ /^([0-9]{4}\-[0-9]{2}\-[0-9]{2} [0-9]{1,2}\:[0-9]{2}\:[0-9]{2})$/
Expand Down

0 comments on commit fceaebe

Please sign in to comment.