restriction shorthand symbols

This commit is contained in:
Adam Meehan
2010-08-07 19:08:35 +10:00
parent 924c6766c1
commit 82ede60985
4 changed files with 56 additions and 1 deletions

View File

@@ -26,6 +26,13 @@ module ValidatesTimeliness
mattr_accessor :ignore_restriction_errors
@@ignore_restriction_errors = defined?(Rails) ? !Rails.env.test? : false
# Shorthand time and date symbols for restrictions
mattr_accessor :restriction_shorthand_symbols
@@restriction_shorthand_symbols = {
:now => lambda { Time.now },
:today => lambda { Date.today }
}
# Setup method for plugin configuration
def self.setup
yield self