validates_timeliness 3.0.0.beta.5 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +130 -0
- data/README.rdoc +2 -2
- data/Rakefile +3 -3
- data/lib/validates_timeliness.rb +13 -4
- data/lib/validates_timeliness/version.rb +1 -1
- data/spec/validates_timeliness_spec.rb +43 -0
- data/validates_timeliness.gemspec +8 -8
- metadata +14 -17
- data/CHANGELOG +0 -131
data/CHANGELOG.rdoc
ADDED
@@ -0,0 +1,130 @@
|
|
1
|
+
= 3.0.0 [2010-10-18]
|
2
|
+
* Rails 3 and ActiveModel compatibility
|
3
|
+
* Uses ActiveModel::EachValidator as validator base class.
|
4
|
+
* Configuration settings stored in ValidatesTimeliness module only. ValidatesTimeliness.setup block to configure.
|
5
|
+
* Parser extracted to the Timeliness gem http://github.com/adzap/timeliness
|
6
|
+
* Parser is disabled by default. See initializer for enabling it.
|
7
|
+
* Removed RSpec matcher. Encouraged poor specs by copy-pasting from spec to model, or worse, the other way round.
|
8
|
+
* Method override for parsing and before type cast values is on validated attributes only. Old version handled all date/datetime columns, validates or not. Too intrusive.
|
9
|
+
* Add validation helpers to classes using extend_orms config setting. e.g. conf.extend_orms = [ :active_record ]
|
10
|
+
* Changed :between option so it is split into :on_or_after and :on_or_before option values. The error message for either failing check will be used instead of a between error message.
|
11
|
+
* Provides :timeliness option key for validates class method. Be sure to pass :type option as well e.g. :type => :date.
|
12
|
+
* Allows validation methods to be called on record instances as per ActiveModel API.
|
13
|
+
* Performs parsing (optional) and raw value caching (before_type_cast) on validated attributes only. It used to be all date, time and datetime attributes.
|
14
|
+
|
15
|
+
= 2.3.1 [2010-03-19]
|
16
|
+
* Fixed bug where custom attribute writer method for date/times were being overriden
|
17
|
+
|
18
|
+
= 2.3.0 [2010-02-04]
|
19
|
+
* Backwards incompatible change to :equal_to option. Fixed error message clash with :equal_to option which exists in Rails already. Option is now :is_at.
|
20
|
+
* Fixed I18n support so it returns missing translation message instead of error
|
21
|
+
* Fixed attribute method bug. Write method was bypassed when method was first generated and used Rails default parser.
|
22
|
+
* Fixed date/time selects when using enable_datetime_select_extension! when some values empty
|
23
|
+
* Fixed ISO8601 datetime format which is now split into two formats
|
24
|
+
* Changed I18n error value format to fallback to global default if missing in locale
|
25
|
+
* Refactored date/time select invalid value extension to use param values. Functionality will be extracted from plugin for v3.
|
26
|
+
|
27
|
+
= 2.2.2 [2009-09-19]
|
28
|
+
* Fixed dummy_time using make_time to respect timezone. Fixes 1.9.1 bug.
|
29
|
+
|
30
|
+
= 2.2.1 [2009-09-12]
|
31
|
+
* Fixed dummy date part for time types in Validator.type_cast_value
|
32
|
+
* No more core extensions! Removed dummy_time methods.
|
33
|
+
|
34
|
+
= 2.2.0 [2009-09-12]
|
35
|
+
* Ruby 1.9 support!
|
36
|
+
* Customise dummy date values for time types. See DUMMY DATE FOR TIME TYPES.
|
37
|
+
* Fixed matcher conflict with Shoulda. Load plugin matcher manually now see matcher section in README
|
38
|
+
* Fixed :ignore_usec when used with :with_time or :with_date
|
39
|
+
* Some clean up and refactoring
|
40
|
+
|
41
|
+
= 2.1.0 [2009-06-20]
|
42
|
+
* Added ambiguous year threshold setting in Formats class to customize the threshold for 2 digit years (See README)
|
43
|
+
* Fixed interpolation values in custom error message for Rails 2.2+
|
44
|
+
* Fixed custom I18n local override of en locale
|
45
|
+
* Dramatically simplified ActiveRecord monkey patching and hackery
|
46
|
+
|
47
|
+
= 2.0.0 [2009-04-12]
|
48
|
+
* Error value formats are now specified in the i18n locale file instead of updating plugin hash. See OTHER CUSTOMISATION section in README.
|
49
|
+
* Date/time select helper extension is disabled by default. To enable see DISPLAY INVALID VALUES IN DATE HELPERS section in README to enable.
|
50
|
+
* Added :format option to limit validation to a single format if desired
|
51
|
+
* Matcher now supports :equal_to option
|
52
|
+
* Formats.parse can take :include_offset option to include offset value from string in seconds, if string contains an offset. Offset not used in rest of plugin yet.
|
53
|
+
* Refactored to remove as much plugin code from ActiveRecord as possible.
|
54
|
+
|
55
|
+
= 1.1.7 [2009-03-26]
|
56
|
+
* Minor change to multiparameter attributes which I had not properly implemented for chaining
|
57
|
+
|
58
|
+
= 1.1.6 [2009-03-19]
|
59
|
+
* Rail 2.3 support
|
60
|
+
* Added :with_date and :with_time options. They allow an attribute to be combined with another attribute or value to make a datetime value for validation against the temporal restrictions
|
61
|
+
* Added :equal_to option
|
62
|
+
* Option key validation
|
63
|
+
* Better behaviour with other plugins using alias_method_chain on read_attribute and define_attribute_methods
|
64
|
+
* Added option to enable datetime_select extension for future use to optionally enable. Enabled by default until version 2.
|
65
|
+
* Added :ignore_usec option for datetime restrictions to be compared without microsecond
|
66
|
+
* some refactoring
|
67
|
+
|
68
|
+
= 1.1.5 [2009-01-21]
|
69
|
+
* Fixed regex for 'yy' format token which wasn't greedy enough for date formats ending with year when a datetime string parsed as date with a 4 digit year
|
70
|
+
|
71
|
+
= 1.1.4 [2009-01-13]
|
72
|
+
* Make months names respect i18n in Formats
|
73
|
+
|
74
|
+
= 1.1.3 [2009-01-13]
|
75
|
+
* Fixed bug where time and date attributes still being parsed on read using Rails default parser [reported by Brad (pvjq)]
|
76
|
+
|
77
|
+
= 1.1.2 [2009-01-12]
|
78
|
+
* Fixed bugs
|
79
|
+
* matcher failing for custom error message without interpolation keys using I18n
|
80
|
+
* validator custom error messages not being extracted
|
81
|
+
|
82
|
+
= 1.1.1 [2009-01-03]
|
83
|
+
* Fixed bug in matcher for options local variable
|
84
|
+
|
85
|
+
= 1.1.0 [2009-01-01]
|
86
|
+
* Added between option
|
87
|
+
|
88
|
+
= 1.0.0 [2008-12-06]
|
89
|
+
* Gemified!
|
90
|
+
* Refactor of plugin into a Data Mapper style validator class which makes for a cleaner implementation and possible future Merb\Data Mapper support
|
91
|
+
* Added Rails 2.2 i18n support. Plugin error messages can specified in locale files. See README.
|
92
|
+
* ignore_datetime_restriction_errors setting has been moved from AR to ValidatesTimeliness::Validator.ignore_restriction_errors
|
93
|
+
* date_time_error_value_formats setting has been moved from AR to ValidatesTimeliness::Validator.error_value_formats
|
94
|
+
* Namespaced modules and specs
|
95
|
+
* Clean up of specs
|
96
|
+
* fixed a few bugs
|
97
|
+
* accessor methods not generating properly due method name stored as symbol in generated_attributes which fails on lookup
|
98
|
+
* force value assigned to time/datetime attributes to time objects
|
99
|
+
|
100
|
+
= 0.1.0 [2008-12-06]
|
101
|
+
* Tagged plugin as version 0.1.0
|
102
|
+
|
103
|
+
= 2008-11-13
|
104
|
+
* allow uppercase meridian to be valid [reported by Alex (http://alex.digns.com/)]
|
105
|
+
|
106
|
+
= 2008-10-28
|
107
|
+
* fixed bug when dirty attributes not reflecting change when attribute changed from time value to nil [reported by Brad (pvjq)]
|
108
|
+
* fixes for Rails 2.2 compatibility. Will refactor in to Rails version specific branches in the future.
|
109
|
+
|
110
|
+
= 2008-09-24
|
111
|
+
* refactored attribute write method definitions
|
112
|
+
|
113
|
+
= 2008-08-25
|
114
|
+
* fixed bug for non-timezone write method not updating changed attributes hash [reported by Sylvestre Mergulhão]
|
115
|
+
|
116
|
+
= 2008-08-22
|
117
|
+
* fixed bug with attribute cache not clearing on write for date and time columns [reported by Sylvestre Mergulhão]
|
118
|
+
* parse method returns Date object for date column assigned string as per normal Rails behaviour
|
119
|
+
* parse method returns same object type when assigned Date or Time object as per normal Rails behaviour
|
120
|
+
|
121
|
+
= 2008-08-07
|
122
|
+
* modified matcher option value parsing to allow same value types as validation method
|
123
|
+
* fixed matcher message
|
124
|
+
|
125
|
+
= 2008-08-02
|
126
|
+
* refactored validation
|
127
|
+
* refactored matcher
|
128
|
+
|
129
|
+
= 2008-07-30
|
130
|
+
* removed setting values to nil when validation fails to preserve before_type_cast value
|
data/README.rdoc
CHANGED
@@ -34,7 +34,7 @@ As plugin (from master)
|
|
34
34
|
As gem (in beta)
|
35
35
|
|
36
36
|
# in Gemfile
|
37
|
-
gem 'validates_timeliness', '
|
37
|
+
gem 'validates_timeliness', '~> 3.0.0'
|
38
38
|
|
39
39
|
# Run bundler
|
40
40
|
$ bundle install
|
@@ -182,7 +182,7 @@ It is highly recommended you use the I18n system for error messages.
|
|
182
182
|
|
183
183
|
=== Plugin Parser
|
184
184
|
|
185
|
-
The uses the {timeliness gem}[http://github.com/adzap/timeliness] as a fast, configurable and extensible date and time parser.
|
185
|
+
The plugin uses the {timeliness gem}[http://github.com/adzap/timeliness] as a fast, configurable and extensible date and time parser.
|
186
186
|
You can add or remove valid formats for dates, times, and datetimes. It is also more strict than the
|
187
187
|
Ruby parser, which means it won't accept day of the month if it's not a valid number for the month.
|
188
188
|
|
data/Rakefile
CHANGED
@@ -14,15 +14,15 @@ spec = Gem::Specification.new do |s|
|
|
14
14
|
s.platform = Gem::Platform::RUBY
|
15
15
|
s.rubyforge_project = "validates_timeliness"
|
16
16
|
s.has_rdoc = true
|
17
|
-
s.extra_rdoc_files = ["README.rdoc", "
|
17
|
+
s.extra_rdoc_files = ["README.rdoc", "CHANGELOG.rdoc", "LICENSE"]
|
18
18
|
s.summary = %q{Date and time validation plugin for Rails which allows custom formats}
|
19
19
|
s.description = s.summary
|
20
20
|
s.author = "Adam Meehan"
|
21
21
|
s.email = "adam.meehan@gmail.com"
|
22
22
|
s.homepage = "http://github.com/adzap/validates_timeliness"
|
23
23
|
s.require_path = 'lib'
|
24
|
-
s.files = %w(validates_timeliness.gemspec LICENSE CHANGELOG README.rdoc Rakefile) + Dir.glob("{lib,spec}/**/*")
|
25
|
-
s.add_runtime_dependency 'timeliness', '~> 0.1.
|
24
|
+
s.files = %w(validates_timeliness.gemspec LICENSE CHANGELOG.rdoc README.rdoc Rakefile) + Dir.glob("{lib,spec}/**/*")
|
25
|
+
s.add_runtime_dependency 'timeliness', '~> 0.1.0'
|
26
26
|
end
|
27
27
|
|
28
28
|
desc 'Default: run specs.'
|
data/lib/validates_timeliness.rb
CHANGED
@@ -11,11 +11,19 @@ require 'active_support/core_ext/date_time/acts_like'
|
|
11
11
|
require 'active_support/core_ext/date_time/conversions'
|
12
12
|
require 'timeliness'
|
13
13
|
|
14
|
+
Timeliness.module_eval do
|
15
|
+
class << self
|
16
|
+
alias :dummy_date_for_time_type :date_for_time_type
|
17
|
+
alias :dummy_date_for_time_type= :date_for_time_type=
|
18
|
+
alias :remove_us_formats :use_euro_formats
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
14
22
|
module ValidatesTimeliness
|
15
23
|
autoload :VERSION, 'validates_timeliness/version'
|
16
24
|
|
17
25
|
class << self
|
18
|
-
delegate :
|
26
|
+
delegate :default_timezone, :default_timezone=, :dummy_date_for_time_type, :dummy_date_for_time_type=, :to => Timeliness
|
19
27
|
end
|
20
28
|
|
21
29
|
# Extend ORM/ODMs for full support (:active_record, :mongoid).
|
@@ -41,11 +49,12 @@ module ValidatesTimeliness
|
|
41
49
|
self.default_timezone = :utc
|
42
50
|
|
43
51
|
# Set the dummy date part for a time type values.
|
44
|
-
def self.dummy_date_for_time_type=(array)
|
45
|
-
Timeliness.date_for_time_type = array
|
46
|
-
end
|
47
52
|
self.dummy_date_for_time_type = [ 2000, 1, 1 ]
|
48
53
|
|
54
|
+
def self.parser
|
55
|
+
Timeliness
|
56
|
+
end
|
57
|
+
|
49
58
|
# Setup method for plugin configuration
|
50
59
|
def self.setup
|
51
60
|
yield self
|
@@ -0,0 +1,43 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe ValidatesTimeliness do
|
4
|
+
|
5
|
+
it 'should alias use_euro_formats to remove_us_formats on Timeliness gem' do
|
6
|
+
Timeliness.should respond_to(:remove_us_formats)
|
7
|
+
end
|
8
|
+
|
9
|
+
it 'should alias to date_for_time_type to dummy_date_for_time_type on Timeliness gem' do
|
10
|
+
Timeliness.should respond_to(:dummy_date_for_time_type)
|
11
|
+
end
|
12
|
+
|
13
|
+
describe "config" do
|
14
|
+
it 'should delegate default_timezone to Timeliness gem' do
|
15
|
+
Timeliness.should_receive(:default_timezone=)
|
16
|
+
ValidatesTimeliness.default_timezone = :utc
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'should delegate dummy_date_for_time_type to Timeliness gem' do
|
20
|
+
Timeliness.should_receive(:dummy_date_for_time_type)
|
21
|
+
Timeliness.should_receive(:dummy_date_for_time_type=)
|
22
|
+
array = ValidatesTimeliness.dummy_date_for_time_type
|
23
|
+
ValidatesTimeliness.dummy_date_for_time_type = array
|
24
|
+
end
|
25
|
+
|
26
|
+
context "parser" do
|
27
|
+
it 'should delegate add_formats to Timeliness gem' do
|
28
|
+
Timeliness.should_receive(:add_formats)
|
29
|
+
ValidatesTimeliness.parser.add_formats
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'should delegate remove_formats to Timeliness gem' do
|
33
|
+
Timeliness.should_receive(:remove_formats)
|
34
|
+
ValidatesTimeliness.parser.remove_formats
|
35
|
+
end
|
36
|
+
|
37
|
+
it 'should delegate remove_us_formats to Timeliness gem' do
|
38
|
+
Timeliness.should_receive(:remove_us_formats)
|
39
|
+
ValidatesTimeliness.parser.remove_us_formats
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -2,15 +2,15 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{validates_timeliness}
|
5
|
-
s.version = "3.0.0
|
5
|
+
s.version = "3.0.0"
|
6
6
|
|
7
|
-
s.required_rubygems_version = Gem::Requirement.new("
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Adam Meehan"]
|
9
|
-
s.date = %q{2010-10-
|
9
|
+
s.date = %q{2010-10-18}
|
10
10
|
s.description = %q{Date and time validation plugin for Rails which allows custom formats}
|
11
11
|
s.email = %q{adam.meehan@gmail.com}
|
12
|
-
s.extra_rdoc_files = ["README.rdoc", "
|
13
|
-
s.files = ["validates_timeliness.gemspec", "LICENSE", "CHANGELOG", "README.rdoc", "Rakefile", "lib/generators", "lib/generators/validates_timeliness", "lib/generators/validates_timeliness/install_generator.rb", "lib/generators/validates_timeliness/templates", "lib/generators/validates_timeliness/templates/en.yml", "lib/generators/validates_timeliness/templates/validates_timeliness.rb", "lib/validates_timeliness", "lib/validates_timeliness/attribute_methods.rb", "lib/validates_timeliness/conversion.rb", "lib/validates_timeliness/extensions", "lib/validates_timeliness/extensions/date_time_select.rb", "lib/validates_timeliness/extensions/multiparameter_handler.rb", "lib/validates_timeliness/extensions.rb", "lib/validates_timeliness/helper_methods.rb", "lib/validates_timeliness/orm", "lib/validates_timeliness/orm/active_record.rb", "lib/validates_timeliness/orm/mongoid.rb", "lib/validates_timeliness/railtie.rb", "lib/validates_timeliness/validator.rb", "lib/validates_timeliness/version.rb", "lib/validates_timeliness.rb", "spec/model_helpers.rb", "spec/spec_helper.rb", "spec/test_model.rb", "spec/validates_timeliness", "spec/validates_timeliness/attribute_methods_spec.rb", "spec/validates_timeliness/conversion_spec.rb", "spec/validates_timeliness/extensions", "spec/validates_timeliness/extensions/date_time_select_spec.rb", "spec/validates_timeliness/extensions/multiparameter_handler_spec.rb", "spec/validates_timeliness/helper_methods_spec.rb", "spec/validates_timeliness/orm", "spec/validates_timeliness/orm/active_record_spec.rb", "spec/validates_timeliness/orm/mongoid_spec.rb", "spec/validates_timeliness/validator", "spec/validates_timeliness/validator/after_spec.rb", "spec/validates_timeliness/validator/before_spec.rb", "spec/validates_timeliness/validator/is_at_spec.rb", "spec/validates_timeliness/validator/on_or_after_spec.rb", "spec/validates_timeliness/validator/on_or_before_spec.rb", "spec/validates_timeliness/validator_spec.rb"]
|
12
|
+
s.extra_rdoc_files = ["README.rdoc", "CHANGELOG.rdoc", "LICENSE"]
|
13
|
+
s.files = ["validates_timeliness.gemspec", "LICENSE", "CHANGELOG.rdoc", "README.rdoc", "Rakefile", "lib/generators", "lib/generators/validates_timeliness", "lib/generators/validates_timeliness/install_generator.rb", "lib/generators/validates_timeliness/templates", "lib/generators/validates_timeliness/templates/en.yml", "lib/generators/validates_timeliness/templates/validates_timeliness.rb", "lib/validates_timeliness", "lib/validates_timeliness/attribute_methods.rb", "lib/validates_timeliness/conversion.rb", "lib/validates_timeliness/extensions", "lib/validates_timeliness/extensions/date_time_select.rb", "lib/validates_timeliness/extensions/multiparameter_handler.rb", "lib/validates_timeliness/extensions.rb", "lib/validates_timeliness/helper_methods.rb", "lib/validates_timeliness/orm", "lib/validates_timeliness/orm/active_record.rb", "lib/validates_timeliness/orm/mongoid.rb", "lib/validates_timeliness/railtie.rb", "lib/validates_timeliness/validator.rb", "lib/validates_timeliness/version.rb", "lib/validates_timeliness.rb", "spec/model_helpers.rb", "spec/spec_helper.rb", "spec/test_model.rb", "spec/validates_timeliness", "spec/validates_timeliness/attribute_methods_spec.rb", "spec/validates_timeliness/conversion_spec.rb", "spec/validates_timeliness/extensions", "spec/validates_timeliness/extensions/date_time_select_spec.rb", "spec/validates_timeliness/extensions/multiparameter_handler_spec.rb", "spec/validates_timeliness/helper_methods_spec.rb", "spec/validates_timeliness/orm", "spec/validates_timeliness/orm/active_record_spec.rb", "spec/validates_timeliness/orm/mongoid_spec.rb", "spec/validates_timeliness/validator", "spec/validates_timeliness/validator/after_spec.rb", "spec/validates_timeliness/validator/before_spec.rb", "spec/validates_timeliness/validator/is_at_spec.rb", "spec/validates_timeliness/validator/on_or_after_spec.rb", "spec/validates_timeliness/validator/on_or_before_spec.rb", "spec/validates_timeliness/validator_spec.rb", "spec/validates_timeliness_spec.rb"]
|
14
14
|
s.homepage = %q{http://github.com/adzap/validates_timeliness}
|
15
15
|
s.require_paths = ["lib"]
|
16
16
|
s.rubyforge_project = %q{validates_timeliness}
|
@@ -22,11 +22,11 @@ Gem::Specification.new do |s|
|
|
22
22
|
s.specification_version = 3
|
23
23
|
|
24
24
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
25
|
-
s.add_runtime_dependency(%q<timeliness>, ["~> 0.1.
|
25
|
+
s.add_runtime_dependency(%q<timeliness>, ["~> 0.1.0"])
|
26
26
|
else
|
27
|
-
s.add_dependency(%q<timeliness>, ["~> 0.1.
|
27
|
+
s.add_dependency(%q<timeliness>, ["~> 0.1.0"])
|
28
28
|
end
|
29
29
|
else
|
30
|
-
s.add_dependency(%q<timeliness>, ["~> 0.1.
|
30
|
+
s.add_dependency(%q<timeliness>, ["~> 0.1.0"])
|
31
31
|
end
|
32
32
|
end
|
metadata
CHANGED
@@ -1,15 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: validates_timeliness
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 7
|
5
|
+
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 0
|
9
9
|
- 0
|
10
|
-
|
11
|
-
- 5
|
12
|
-
version: 3.0.0.beta.5
|
10
|
+
version: 3.0.0
|
13
11
|
platform: ruby
|
14
12
|
authors:
|
15
13
|
- Adam Meehan
|
@@ -17,7 +15,7 @@ autorequire:
|
|
17
15
|
bindir: bin
|
18
16
|
cert_chain: []
|
19
17
|
|
20
|
-
date: 2010-10-
|
18
|
+
date: 2010-10-18 00:00:00 +11:00
|
21
19
|
default_executable:
|
22
20
|
dependencies:
|
23
21
|
- !ruby/object:Gem::Dependency
|
@@ -28,12 +26,12 @@ dependencies:
|
|
28
26
|
requirements:
|
29
27
|
- - ~>
|
30
28
|
- !ruby/object:Gem::Version
|
31
|
-
hash:
|
29
|
+
hash: 27
|
32
30
|
segments:
|
33
31
|
- 0
|
34
32
|
- 1
|
35
|
-
-
|
36
|
-
version: 0.1.
|
33
|
+
- 0
|
34
|
+
version: 0.1.0
|
37
35
|
type: :runtime
|
38
36
|
version_requirements: *id001
|
39
37
|
description: Date and time validation plugin for Rails which allows custom formats
|
@@ -44,12 +42,12 @@ extensions: []
|
|
44
42
|
|
45
43
|
extra_rdoc_files:
|
46
44
|
- README.rdoc
|
45
|
+
- CHANGELOG.rdoc
|
47
46
|
- LICENSE
|
48
|
-
- CHANGELOG
|
49
47
|
files:
|
50
48
|
- validates_timeliness.gemspec
|
51
49
|
- LICENSE
|
52
|
-
- CHANGELOG
|
50
|
+
- CHANGELOG.rdoc
|
53
51
|
- README.rdoc
|
54
52
|
- Rakefile
|
55
53
|
- lib/generators/validates_timeliness/install_generator.rb
|
@@ -83,6 +81,7 @@ files:
|
|
83
81
|
- spec/validates_timeliness/validator/on_or_after_spec.rb
|
84
82
|
- spec/validates_timeliness/validator/on_or_before_spec.rb
|
85
83
|
- spec/validates_timeliness/validator_spec.rb
|
84
|
+
- spec/validates_timeliness_spec.rb
|
86
85
|
has_rdoc: true
|
87
86
|
homepage: http://github.com/adzap/validates_timeliness
|
88
87
|
licenses: []
|
@@ -104,14 +103,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
104
103
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
105
104
|
none: false
|
106
105
|
requirements:
|
107
|
-
- - "
|
106
|
+
- - ">="
|
108
107
|
- !ruby/object:Gem::Version
|
109
|
-
hash:
|
108
|
+
hash: 3
|
110
109
|
segments:
|
111
|
-
-
|
112
|
-
|
113
|
-
- 1
|
114
|
-
version: 1.3.1
|
110
|
+
- 0
|
111
|
+
version: "0"
|
115
112
|
requirements: []
|
116
113
|
|
117
114
|
rubyforge_project: validates_timeliness
|
data/CHANGELOG
DELETED
@@ -1,131 +0,0 @@
|
|
1
|
-
= 3.0.0.beta
|
2
|
-
- Rails 3 and ActiveModel compatibility
|
3
|
-
- Uses ActiveModel::EachValidator as validator base class.
|
4
|
-
- Configuration settings stored in ValidatesTimeliness module only. ValidatesTimeliness.setup block to configure.
|
5
|
-
- Parser extracted to the Timeliness gem http://github.com/adzap/timeliness
|
6
|
-
- Parser is disabled by default. See initializer for enabling it.
|
7
|
-
- Removed RSpec matcher. Encouraged poor specs by copy-pasting from spec to model, or worse, the other way round.
|
8
|
-
- Method override for parsing and before type cast values is on validated attributes only. Old version handled all date/datetime columns, validates or not. Too intrusive.
|
9
|
-
- Add validation helpers to classes using extend_orms config setting. e.g. conf.extend_orms = [ :active_record ]
|
10
|
-
- Changed :between option so it is split into :on_or_after and :on_or_before option values. The error message for either failing check will be used instead of a between error message.
|
11
|
-
- Provides :timeliness option key for validates class method. Be sure to pass :type option as well e.g. :type => :date.
|
12
|
-
- Allows validation methods to be called on record instances as per ActiveModel API
|
13
|
-
- Performs parsing (optional) and raw value caching (before_type_cast) on validated attributes only. It used to be all date, time and datetime attributes.
|
14
|
-
- Fix meridian bug where time parsed with hour of 0 or greater than 12 was accepted.
|
15
|
-
|
16
|
-
= 2.3.1 [2010-03-19]
|
17
|
-
- Fixed bug where custom attribute writer method for date/times were being overriden
|
18
|
-
|
19
|
-
= 2.3.0 [2010-02-04]
|
20
|
-
- Backwards incompatible change to :equal_to option. Fixed error message clash with :equal_to option which exists in Rails already. Option is now :is_at.
|
21
|
-
- Fixed I18n support so it returns missing translation message instead of error
|
22
|
-
- Fixed attribute method bug. Write method was bypassed when method was first generated and used Rails default parser.
|
23
|
-
- Fixed date/time selects when using enable_datetime_select_extension! when some values empty
|
24
|
-
- Fixed ISO8601 datetime format which is now split into two formats
|
25
|
-
- Changed I18n error value format to fallback to global default if missing in locale
|
26
|
-
- Refactored date/time select invalid value extension to use param values. Functionality will be extracted from plugin for v3.
|
27
|
-
|
28
|
-
= 2.2.2 [2009-09-19]
|
29
|
-
- Fixed dummy_time using make_time to respect timezone. Fixes 1.9.1 bug.
|
30
|
-
|
31
|
-
= 2.2.1 [2009-09-12]
|
32
|
-
- Fixed dummy date part for time types in Validator.type_cast_value
|
33
|
-
- No more core extensions! Removed dummy_time methods.
|
34
|
-
|
35
|
-
= 2.2.0 [2009-09-12]
|
36
|
-
- Ruby 1.9 support!
|
37
|
-
- Customise dummy date values for time types. See DUMMY DATE FOR TIME TYPES.
|
38
|
-
- Fixed matcher conflict with Shoulda. Load plugin matcher manually now see matcher section in README
|
39
|
-
- Fixed :ignore_usec when used with :with_time or :with_date
|
40
|
-
- Some clean up and refactoring
|
41
|
-
|
42
|
-
= 2.1.0 [2009-06-20]
|
43
|
-
- Added ambiguous year threshold setting in Formats class to customize the threshold for 2 digit years (See README)
|
44
|
-
- Fixed interpolation values in custom error message for Rails 2.2+
|
45
|
-
- Fixed custom I18n local override of en locale
|
46
|
-
- Dramatically simplified ActiveRecord monkey patching and hackery
|
47
|
-
|
48
|
-
= 2.0.0 [2009-04-12]
|
49
|
-
- Error value formats are now specified in the i18n locale file instead of updating plugin hash. See OTHER CUSTOMISATION section in README.
|
50
|
-
- Date/time select helper extension is disabled by default. To enable see DISPLAY INVALID VALUES IN DATE HELPERS section in README to enable.
|
51
|
-
- Added :format option to limit validation to a single format if desired
|
52
|
-
- Matcher now supports :equal_to option
|
53
|
-
- Formats.parse can take :include_offset option to include offset value from string in seconds, if string contains an offset. Offset not used in rest of plugin yet.
|
54
|
-
- Refactored to remove as much plugin code from ActiveRecord as possible.
|
55
|
-
|
56
|
-
= 1.1.7 [2009-03-26]
|
57
|
-
- Minor change to multiparameter attributes which I had not properly implemented for chaining
|
58
|
-
|
59
|
-
= 1.1.6 [2009-03-19]
|
60
|
-
- Rail 2.3 support
|
61
|
-
- Added :with_date and :with_time options. They allow an attribute to be combined with another attribute or value to make a datetime value for validation against the temporal restrictions
|
62
|
-
- Added :equal_to option
|
63
|
-
- Option key validation
|
64
|
-
- Better behaviour with other plugins using alias_method_chain on read_attribute and define_attribute_methods
|
65
|
-
- Added option to enable datetime_select extension for future use to optionally enable. Enabled by default until version 2.
|
66
|
-
- Added :ignore_usec option for datetime restrictions to be compared without microsecond
|
67
|
-
- some refactoring
|
68
|
-
|
69
|
-
= 1.1.5 [2009-01-21]
|
70
|
-
- Fixed regex for 'yy' format token which wasn't greedy enough for date formats ending with year when a datetime string parsed as date with a 4 digit year
|
71
|
-
|
72
|
-
= 1.1.4 [2009-01-13]
|
73
|
-
- Make months names respect i18n in Formats
|
74
|
-
|
75
|
-
= 1.1.3 [2009-01-13]
|
76
|
-
- Fixed bug where time and date attributes still being parsed on read using Rails default parser [reported by Brad (pvjq)]
|
77
|
-
|
78
|
-
= 1.1.2 [2009-01-12]
|
79
|
-
- Fixed bugs
|
80
|
-
- matcher failing for custom error message without interpolation keys using I18n
|
81
|
-
- validator custom error messages not being extracted
|
82
|
-
|
83
|
-
= 1.1.1 [2009-01-03]
|
84
|
-
- Fixed bug in matcher for options local variable
|
85
|
-
|
86
|
-
= 1.1.0 [2009-01-01]
|
87
|
-
- Added between option
|
88
|
-
|
89
|
-
= 1.0.0 [2008-12-06]
|
90
|
-
- Gemified!
|
91
|
-
- Refactor of plugin into a Data Mapper style validator class which makes for a cleaner implementation and possible future Merb\Data Mapper support
|
92
|
-
- Added Rails 2.2 i18n support. Plugin error messages can specified in locale files. See README.
|
93
|
-
- ignore_datetime_restriction_errors setting has been moved from AR to ValidatesTimeliness::Validator.ignore_restriction_errors
|
94
|
-
- date_time_error_value_formats setting has been moved from AR to ValidatesTimeliness::Validator.error_value_formats
|
95
|
-
- Namespaced modules and specs
|
96
|
-
- Clean up of specs
|
97
|
-
- fixed a few bugs
|
98
|
-
- accessor methods not generating properly due method name stored as symbol in generated_attributes which fails on lookup
|
99
|
-
- force value assigned to time/datetime attributes to time objects
|
100
|
-
|
101
|
-
= 0.1.0 [2008-12-06]
|
102
|
-
- Tagged plugin as version 0.1.0
|
103
|
-
|
104
|
-
= 2008-11-13
|
105
|
-
- allow uppercase meridian to be valid [reported by Alex (http://alex.digns.com/)]
|
106
|
-
|
107
|
-
= 2008-10-28
|
108
|
-
- fixed bug when dirty attributes not reflecting change when attribute changed from time value to nil [reported by Brad (pvjq)]
|
109
|
-
- fixes for Rails 2.2 compatibility. Will refactor in to Rails version specific branches in the future.
|
110
|
-
|
111
|
-
= 2008-09-24
|
112
|
-
- refactored attribute write method definitions
|
113
|
-
|
114
|
-
= 2008-08-25
|
115
|
-
- fixed bug for non-timezone write method not updating changed attributes hash [reported by Sylvestre Mergulhão]
|
116
|
-
|
117
|
-
= 2008-08-22
|
118
|
-
- fixed bug with attribute cache not clearing on write for date and time columns [reported by Sylvestre Mergulhão]
|
119
|
-
- parse method returns Date object for date column assigned string as per normal Rails behaviour
|
120
|
-
- parse method returns same object type when assigned Date or Time object as per normal Rails behaviour
|
121
|
-
|
122
|
-
= 2008-08-07
|
123
|
-
- modified matcher option value parsing to allow same value types as validation method
|
124
|
-
- fixed matcher message
|
125
|
-
|
126
|
-
= 2008-08-02
|
127
|
-
- refactored validation
|
128
|
-
- refactored matcher
|
129
|
-
|
130
|
-
= 2008-07-30
|
131
|
-
- removed setting values to nil when validation fails to preserve before_type_cast value
|