Comments (7)
I should mention that for me, ValidatesTimeliness.enable_datetime_select_extension! doesn't just add something nice (the idea of displaying the bad date). If I do not have that line, the gem does not work for me at all. What I mean is that without that line, a bad date passes by as it does in normal Rails, with November 31st becoming December 1st, and no error is raised.
from validates_timeliness.
+1 in Rails 3
from validates_timeliness.
+1 in Rails 3.0.5
from validates_timeliness.
+1 for Rails 3.
from validates_timeliness.
I created a fork with a patch for v2.3. Unfortunately I do not have an install of Rails 3 to fix the latest release, but I will try to look at it. If you have Rails 2.3.5 you can look here for the fix: https://github.com/miskander/validates_timeliness. It was submitted to ruby gems, see http://rubygems.org/gems/markos_validates_timeliness.
from validates_timeliness.
Is this resolved in Rails 3?
from validates_timeliness.
I believe it is mostly resolved in Rails 3. I have just been able to migrate to Rails 3.2.8, and now the bad date is usually shown in the date_select when there are errors.
I say "mostly," and "usually," because there is one case where it does not work. If the bad date is within a nested object, and the date_select is therefore within a nested form, then the entire date gets wiped out. I believe this happens before returning to the view. Basically, the validation from validates_timeliness runs fine, and correctly adds the error for a bad date. This validation is in the model of the nested object. In that same model, a separate validation to see that the date is not blank will also fire, making me think that the validation for the bad date may have wiped it out. Then, of course, the page shows no date when it reloads.
If the date is good, then it is still shown in the date_select. Only bad dates are cleared out.
I do have config.enable_date_time_select_extension! on in the gem's initializer. I am using validates_timeliness version 3.0.14. Any ideas?
from validates_timeliness.
Related Issues (20)
- No configuration required per thread (compatibility with timeliness 0.4.0+ HOT 7
- No support for midnight with :time type HOT 1
- NoMethodError: undefined method `deduplicate' with ActiveRecord 6.1 HOT 3
- Doesn't work with Ruby 3.0 / Rails 6.1 (PR attached) HOT 5
- Gem in 5.0.0 version not execute "timeliness" validations in ActiveRecord models HOT 12
- Update `CHANGELOG.rdoc` for v5.0.0 HOT 1
- Check time_zone_aware_types HOT 3
- Plans to release a official 6.x version HOT 3
- `add_error` call with wrong number of arguments HOT 2
- Issue on engine test load HOT 2
- ArgumentError: wrong number of arguments (given 3, expected 1..2) on records.error.add HOT 8
- Locale for Vietnamese HOT 2
- Rails 7 Deprecation Warnings HOT 6
- Rails 7 dependency - activemodel HOT 4
- Please support Rails 7 then cut a new version HOT 1
- Additional maintainer needed HOT 2
- Support for Rails 7 HOT 4
- Is there any way that I can make sure that ranges are exclusive?
- Handle when the passed value is not a Date value. when it's a Numeric
- Comparison to ComparisonValidator HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from validates_timeliness.