mirror of
https://github.com/ditkrg/validates_timeliness.git
synced 2026-01-25 15:22:58 +00:00
small cleanup and correction of docs
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
module ValidatesTimeliness
|
module ValidatesTimeliness
|
||||||
|
|
||||||
# The crux of the plugin is being able to store raw user entered values,
|
# The crux of the plugin is being able to store raw user entered values
|
||||||
# while not interferring with the Rails 2.1 automatic timezone handling. This
|
# while not interfering with the Rails 2.1 automatic timezone handling. This
|
||||||
# requires us to distinguish a user entered value from a value read from the
|
# requires us to distinguish a user entered value from a value read from the
|
||||||
# database. Both maybe in string form, but only the database value should be
|
# database. Both maybe in string form, but only the database value should be
|
||||||
# interpreted as being in the default timezone which is normally UTC. The user
|
# interpreted as being in the default timezone which is normally UTC. The user
|
||||||
@@ -18,10 +18,6 @@ module ValidatesTimeliness
|
|||||||
# The wholesale replacement of the Rails time type casting is not done to
|
# The wholesale replacement of the Rails time type casting is not done to
|
||||||
# preserve the quickest conversion for timestamp columns and also any value
|
# preserve the quickest conversion for timestamp columns and also any value
|
||||||
# which is never changed during the life of the record object.
|
# which is never changed during the life of the record object.
|
||||||
#
|
|
||||||
# Dates are also handled but only write to cache value converted by plugin
|
|
||||||
# parser. Default read method will retrieve from cache or do default
|
|
||||||
# conversion
|
|
||||||
module AttributeMethods
|
module AttributeMethods
|
||||||
|
|
||||||
def self.included(base)
|
def self.included(base)
|
||||||
@@ -64,7 +60,7 @@ module ValidatesTimeliness
|
|||||||
# Writes attribute value by storing raw value in attributes hash,
|
# Writes attribute value by storing raw value in attributes hash,
|
||||||
# then convert it with parser and cache it.
|
# then convert it with parser and cache it.
|
||||||
#
|
#
|
||||||
# If Rails 2.1 dirty attributes is enabled then the value is added to
|
# If Rails dirty attributes is enabled then the value is added to
|
||||||
# changed attributes if changed. Can't use the default dirty checking
|
# changed attributes if changed. Can't use the default dirty checking
|
||||||
# implementation as it chains the write_attribute method which deletes
|
# implementation as it chains the write_attribute method which deletes
|
||||||
# the attribute from the cache.
|
# the attribute from the cache.
|
||||||
|
|||||||
@@ -189,7 +189,7 @@ module ValidatesTimeliness
|
|||||||
# Adds new formats. Must specify format type and can specify a :before
|
# Adds new formats. Must specify format type and can specify a :before
|
||||||
# option to nominate which format the new formats should be inserted in
|
# option to nominate which format the new formats should be inserted in
|
||||||
# front on to take higher precedence.
|
# front on to take higher precedence.
|
||||||
# Error is raise if format already exists or if :before format is not found.
|
# Error is raised if format already exists or if :before format is not found.
|
||||||
def add_formats(type, *add_formats)
|
def add_formats(type, *add_formats)
|
||||||
formats = self.send("#{type}_formats")
|
formats = self.send("#{type}_formats")
|
||||||
options = {}
|
options = {}
|
||||||
|
|||||||
Reference in New Issue
Block a user