Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

dates are not saving into database #6442

Closed
gsonicis opened this Issue May 22, 2012 · 5 comments

Comments

Projects
None yet
2 participants

I am using rails 3.2.

If a user didn't specified any month,only provided the year , date will be not save into database.I think earlier i don't have this issue(rails 3.1)

please let me know if more inro are require.

thanks:)

Owner

rafaelfranca commented May 22, 2012

We will need a failing test case, or an example application reproducing the issue or steps to reproduce it.

also using simpleform+nested form
Step:
When I gave the full date means year and month then its ok,but when give blank filed in the month then date not saved.before that it takes 1st jan as default month.

= f.input :end_date, 
        :hint =>t('text.leave_blank'),
        :start_year => Date.today.year, 
        :end_year => Date.today.year - 90, 
        :include_blank => true

thanks:)

Owner

rafaelfranca commented May 22, 2012

I'm sure that this never worked in this way. If you leave the month blank the Active Record will not parse it to a date.

Owner

rafaelfranca commented May 22, 2012

I looked in the source code and you are right. in Rails 3.1 this works. I'll take a look in the reason of the change.

Owner

rafaelfranca commented May 22, 2012

Looking in the code I saw that this change was proposital as you can see in #2086. I'm closing this issue now. Thank you for reporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment