Adding .year to the date options made no difference for me.

I have no clue why this is happening but would be glad to run any
diagnostics you or others might suggest.

On Mar 13, 6:15 am, Kenny Ortmann <[email protected]> wrote:
> I looked into the year thing, I had to make one change
>
> config.columns[:birth_day].options = {:start_year => 0.years.from_now.year,
> :end_year => 3.years.from_now.year}
>
> that seems to be narrowing down the year for me.
>
> Do you have any clues as to why your date is coming back null?
>
> On Thu, Mar 12, 2009 at 5:06 PM, BillSaysThis <[email protected]> wrote:
>
> > Have you found any answer for this? Not being able to save on models
> > with dates while using the calendar date select gem is kind of a
> > roadblock...
>
> > On Mar 8, 3:02 pm, BillSaysThis <[email protected]> wrote:
> > > I'd rather not mess with the meeting_date field in the
> > > before_create_save, I'm just trying to get around that meeting_date
> > > cannot be null error.
>
> > > On Mar 8, 2:21 pm, Kenny Ortmann <[email protected]> wrote:
>
> > > > I'm gonna look into theoptionsnot working tomorrow and see if I can
> > figure
> > > > out what's going on.
>
> > > > What are you trying to do with the meeting date in the
> > before_create_save
> > > > method??  You shouldn't have to touch the model, rails handles parsing
> > the
> > > > date back out of the params when you pass the params to the model.
>
> > > > On Sun, Mar 8, 2009 at 1:59 PM, BillSaysThis <[email protected]> wrote:
>
> > > > > How is the calendar_date_select_value accessed in a
> > before_create_save
> > > > > method? (I get the same error if there's no before_create_save method
> > > > > too.)
>
> > > > > Code:
>
> > > > >  (from the controller config block)
>
> > > > >    config.columns[:meeting_date].options= {:start_year =>
> > > > > 0.years.from_now, :end_year => 3.years.from_now}
>
> > > > >   def before_create_save(record)
> > > > >    # March 10, 2009
> > > > >    md = record.meeting_date
> > > > >    sd = md.split(%r{,\s*})
> > > > >    sdd = Date.new(sd.last, Date::MONTHNAMES.index(sd.second),
> > > > > sd.first)
> > > > >    record.meeting_date = sdd
> > > > >  end
>
> > > > > Error I get:
>
> > > > > Mysql::Error: Column 'meeting_date' cannot be null: UPDATE `meetings`
> > > > > SET `meeting_date` = NULL ...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to