include timezone awareness option for attribute parsing

This commit is contained in:
Adam Meehan
2010-09-21 18:27:12 +10:00
parent c8ad4cd525
commit bf57efaaa6
2 changed files with 8 additions and 5 deletions

View File

@@ -19,7 +19,7 @@ module ValidatesTimeliness
def #{attr_name}=(value)
@attributes_cache ||= {}
@attributes_cache["_#{attr_name}_before_type_cast"] = value
#{ "value = ValidatesTimeliness::Parser.parse(value, :#{type}) if value.is_a?(String)" if ValidatesTimeliness.use_plugin_parser }
#{ "value = ValidatesTimeliness::Parser.parse(value, :#{type}, :timezone_aware => #{timezone_aware}) if value.is_a?(String)" if ValidatesTimeliness.use_plugin_parser }
super
end
EOV
@@ -35,6 +35,8 @@ module ValidatesTimeliness
class_eval(method_body, __FILE__, line)
end
public
def timeliness_attribute_timezone_aware?(attr_name)
false
end