mirror of
https://github.com/ditkrg/validates_timeliness.git
synced 2026-01-22 22:06:45 +00:00
removed some naff comments
This commit is contained in:
parent
1596ffd2cb
commit
c386a9cdcf
@ -1,8 +1,6 @@
|
|||||||
module ValidatesTimeliness
|
module ValidatesTimeliness
|
||||||
module ValidationMethods
|
module ValidationMethods
|
||||||
|
|
||||||
# Error messages and error value formats added to AR defaults to allow
|
|
||||||
# global override.
|
|
||||||
def self.included(base)
|
def self.included(base)
|
||||||
base.extend ClassMethods
|
base.extend ClassMethods
|
||||||
end
|
end
|
||||||
@ -30,24 +28,18 @@ module ValidatesTimeliness
|
|||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
|
|
||||||
# Use this validation to force validation of values and restrictions
|
|
||||||
# as dummy time
|
|
||||||
def validates_time(*attr_names)
|
def validates_time(*attr_names)
|
||||||
configuration = attr_names.extract_options!
|
configuration = attr_names.extract_options!
|
||||||
configuration[:type] = :time
|
configuration[:type] = :time
|
||||||
validates_timeliness_of(attr_names, configuration)
|
validates_timeliness_of(attr_names, configuration)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Use this validation to force validation of values and restrictions
|
|
||||||
# as Date
|
|
||||||
def validates_date(*attr_names)
|
def validates_date(*attr_names)
|
||||||
configuration = attr_names.extract_options!
|
configuration = attr_names.extract_options!
|
||||||
configuration[:type] = :date
|
configuration[:type] = :date
|
||||||
validates_timeliness_of(attr_names, configuration)
|
validates_timeliness_of(attr_names, configuration)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Use this validation to force validation of values and restrictions
|
|
||||||
# as Time/DateTime
|
|
||||||
def validates_datetime(*attr_names)
|
def validates_datetime(*attr_names)
|
||||||
configuration = attr_names.extract_options!
|
configuration = attr_names.extract_options!
|
||||||
configuration[:type] = :datetime
|
configuration[:type] = :datetime
|
||||||
@ -56,8 +48,6 @@ module ValidatesTimeliness
|
|||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
# The main validation method which can be used directly or called through
|
|
||||||
# the other specific type validation methods
|
|
||||||
def validates_timeliness_of(*attr_names)
|
def validates_timeliness_of(*attr_names)
|
||||||
configuration = attr_names.extract_options!
|
configuration = attr_names.extract_options!
|
||||||
validator = ValidatesTimeliness::Validator.new(configuration)
|
validator = ValidatesTimeliness::Validator.new(configuration)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user