Adam Meehan
f8e6480f58
use ActiveSupport Array.wrap
2019-08-20 10:38:38 -10:00
Adam Meehan
4523138c3c
Add Rails initializer to set Timeliness.ambiguous_date_format for Timeliness v0.4+
2019-08-03 12:38:39 +10:00
Adam Meehan
e645a938b6
remove skipped specs which no longer apply
2018-06-06 13:34:20 -10:00
Adam Meehan
093e33fbed
Move conversion module methods in Converter class
...
Encapsulate conversion helper methods
2018-05-19 16:28:35 +10:00
Adam Meehan
e5bb096161
Move method generation to ActiveModel only and use type system in AR
...
The ActiveModel type system with extensions in ActiveRecord provide
us a lot of convenience. Some general attribute code is now moved to
ActiveModel only as the AR types provide raw value capturing
(before_type_cast) and type classes to handle type specific string
value parsing if enabled.
In my view, we need to go futher and strip out more from ActiveModel
extension but at least we should have compatibility at the moment.
2018-05-19 15:22:23 +10:00
Adam Meehan
4582c96c42
Time only values are zone aware from AR 5.0
2018-05-18 09:27:16 +10:00
Adam Meehan
1c2f4c1b05
turn off timezone aware check specs for now
2018-05-18 09:13:46 +10:00
Adam Meehan
402a6b6e3e
Change multiparamter extension to use AR type classes
...
Multiparamter extension used to do a lot of crappy work to ensure that
the invalid Date dates were not accepted, but also to store a
before_type_cast value in cases when it was invalid. We no longer need
to handle the before_type_cast value as ActiveRecord does that nicely.
Now we just ensure values to cast with a invalid date parts is not
accepted.
2018-05-18 08:58:00 +10:00
Adam Meehan
076714d648
update hash syntax in spec
2018-05-16 12:54:32 +10:00
Adam Meehan
8dc191a4cd
Update TextModel method_missing with current ActiveModel methods
2018-05-15 19:26:54 +10:00
Adam Meehan
7d006bd3bd
not a fix but stops stack recursion problem
2018-05-15 17:22:43 +10:00
Adam Meehan
43554d8bf0
Merge pull request #152 from aditya-kapoor/allow-generic-msg
...
Allow the validator to take in the `message` option too.
2018-05-13 20:50:08 +10:00
Adam Meehan
13fcc32a83
Test model had wrong validation method
2017-05-14 20:12:36 +10:00
Aditya Kapoor
e9c9914c4f
Allow the validator to take in the message option too. This is useful in those scenarios where we have a set of generic keys which we need to show.
...
This would eliminate the need to keeping multiple copies for the default keys set defined by gem.
The following seems more apt than the later one:
```
validates_date :start_at, on_or_after: :today, message: 'should not be in past'
```
```
validates_date :start_at, on_or_after: :today, on_or_after_message: 'should not be in past'
```
2017-03-22 13:21:59 +05:30
Adam Meehan
35caf3638e
Fix undefine_attribute_methods spec
2016-01-07 20:50:17 +11:00
Adam Meehan
321834b5ff
Fix thread lock on undefine
...
Move active model methods into active model ORM module to be included
manually if not using AR or other ORM
2016-01-06 22:18:54 +11:00
Adam Meehan
d57c64dcc2
Getting with the RSpec times
2015-12-30 12:06:42 +11:00
Adam Meehan
0feeb746cd
Fix zone in test
2015-12-29 17:57:54 +11:00
Adam Meehan
0444bdc650
Datetime select extension fixes with help from @johncarney's fork
2015-12-29 15:49:18 +11:00
Adam Meehan
08b16f155c
Rspec 3 syntax
2015-12-29 14:55:03 +11:00
Adam Meehan
1ddf0f1b0f
Remove all mongoid stuff and put in validates_timeliness-mongoid
2015-12-28 14:24:24 +11:00
Adam Meehan
6560a09ad2
Change Time.local_time to Time.local
2015-12-28 13:47:11 +11:00
Johnny Shields
99ae8fe7d7
Update for Mongoid 3:
...
- Now requires Mongoid 3.0 as minimum version (this is the only version to support Rails 3.2)
- Upgrade specs/helpers for Mongoid 3
- Support Mongoid aliased field names (e.g. field :foo, as: bar, type: String). Includes spec
- Support before_type_cast on Mongoid. No code change was required for this, only a spec change.
- There was one mongoid spec that was previously marked pending. I've found that it now works on Mongoid 3.
- Removed some Mongoid 2.3 and earlier hacks, which simplifies the Mongoid ORM code.
2013-07-24 11:05:01 +09:00
Adam Meehan
00ce472d3e
Merge pull request #99 from softace/fixing_build
...
Fix for running tests in non-Australian timezones
2013-06-16 15:22:33 -07:00
Jarl Friis
0d2c7ce554
Fix for running tests in non-Australian timezones
2013-04-30 19:56:19 +02:00
Alexey Chernenkov
dc0fdc0340
Range with excluded end passed to :between option should be split into :on_or_after and :before options
2013-04-30 15:37:44 +06:00
Adam Meehan
7dd579b0e0
Get rid of this silly constant for nil array value
2012-10-15 08:45:57 +11:00
Adam Meehan
2225c747e1
DRYing up some specs
2012-08-26 16:38:00 +10:00
Adam Meehan
02fbdc6028
Fix for validates :timeliness form to add attributes to plugin set
2012-08-23 18:38:33 +10:00
Adam Meehan
091e7ecfa0
Tweak AR specs
2012-08-21 10:53:54 +10:00
Adam Meehan
62557e7e04
Allow any validated attribute to pass timezone aware check in AR
2012-08-09 12:53:29 +10:00
Adam Meehan
7bcdea1738
RSpec config cleanup
2012-07-13 21:43:29 +10:00
Adam Meehan
4aa20bb002
Stricter method signature for _timeliness_raw_value_for to take string
...
Add basic validation specs to each ORM shim
2012-03-29 13:00:28 +11:00
Adam Meehan
f11255a7a3
Fix multiparameter extension to not allow partial dates as per ActiveRecord implementation.
2012-03-26 20:22:09 +11:00
Adam Meehan
43f49076fb
Changed multiparameter implementation to be more like AR 3.1 but backwards compatible
...
Specs improved to not make direct call to multiparameter method.
2012-02-02 09:00:14 +11:00
Chris Griego
64a7440de4
Fix multiparameter extension to work with ActiveRecord 3.1
2012-02-02 08:54:39 +11:00
Chris Griego
2702ec3266
The ActiveRecord extension now returns the original return value for .define_attribute_methods
...
This helps other extensions, like PermalinkFu, which depend on the return value
2012-02-02 08:44:22 +11:00
Adam Meehan
4acd0180f9
Add specs for allow_nil and allow_blank with attribute value cache active
2012-02-01 21:25:42 +11:00
Adam Meehan
3f4615e053
scope a spec to AR version
2012-02-01 21:25:05 +11:00
Adam Meehan
5be45b00db
Hook into undefine_attributes_methods to remove timeliness methods as well
2012-02-01 20:38:05 +11:00
Adam Meehan
f8aeeca0a9
A fix for ActiveRecord 3.1.x and plugin parser not working together (issue #52 )
2012-01-26 22:44:01 +11:00
Adam Meehan
907fd3e439
Fix for Mongoid shim for reload which was nicely moved into a module to allow super
2011-12-10 17:46:35 +11:00
Adam Meehan
86b7bc4829
Fix before_type_cast for non-dirty attributes (issue #52 ).
...
Only use before_type_cast implementation if earlier than 3.1.0 which has
it's own working version for date/time fields now.
2011-09-21 21:28:53 +10:00
Adam Meehan
11ae94cba6
Cleanup DateTimeSelect extension specs
2011-09-18 18:53:38 +10:00
Adam Meehan
473da0fa5e
Fix DateTimeSelect extension for Rails 3.1.0
2011-09-18 18:37:01 +10:00
Adam Meehan
e7b503ae4f
Fix DateTimeSelect extension to use integers from param values.
...
Change extension spec to use string params.
2011-09-18 18:34:23 +10:00
Adam Meehan
af9d6cdba4
Fix brokena and brittle tests
2011-09-18 18:33:30 +10:00
Adam Meehan
969edfcb83
Helper method spec
2011-09-18 18:33:29 +10:00
Adam Meehan
1faf0efa4b
Spec helper validate method setup in test models not needed
2011-09-18 18:33:29 +10:00
Thilo Rusche
b4c1a39343
added support for :discard_day in form helpers
2011-05-13 17:13:11 +01:00