I just implemented the new bleeding edge trunk version.
Everything looked fine on the surface.
Now none of my dates can be sent to the DB uder both create and
update.
I get this error when I create or update
NoMethodError (undefined method `usec' for #<Date:
4908755/2,0,2299161>):
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/
active_record/connection_adapters/postgresql_adapter.rb:129:in
`quoted_date'
/vendor/plugins/dhtml_calendar/lib/extensions/active_record.rb:
42:in `quote'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/
active_record/connection_adapters/postgresql_adapter.rb:120:in `quote'
I am using PostgreSQL DB due avoid the sticky licensing issue of
MySQL.
It used to work with the AS plugin.
I have a date field called birthdate as defined in my migrate as date
type.
I need to use the trunk because I plan to get the DHTML pop up
calendar running again.
What is strange is that when I add a date to the DB directly then run
the Rails app and edit the customer I see the birthday displayed
correctly.
If I do not change anything and then click update I get the same
error.
Currently the date in the DB is shown like
2007-12-31
and when I used the pop up it is also shown like 2007-12-31
So I know it is not a date style problem.
Can anyone help me?
Thanks in advance
Uncle Mike
Processing CustomersController#create (for 127.0.0.1 at 2007-10-04
10:42:30) [POST]
Session ID: 3715b309d27a713eb4ea10e90b30c0f3
Parameters: {"commit"=>"Create", "action"=>"create",
"controller"=>"customers", "birthdate(1i)"=>"2007",
"lastname"=>"Soap", "firstname"=>"Joe", "birthdate(2i)"=>"10",
"birthdate(3i)"=>"4", "mobile"=>"", "fax"=>"123-122",
"town"=>"warawara", "telephone"=>"123-645",
"customer_status"=>{"id"=>"1"}, "email"=>"m...@mw.com"}}
Whats up with the birthdate being split up like that?
I only have one birthdate field in the DB called birthdate.
Why don't you make a copy of your project and then test it with dhtml.
I have a nasty suspicion that it is due to the Postgres Adapter.
If it is so, you could try to repost your question on Ruby on Rails :
Talk google group.
The problem is strange.
All I do is install the DHTML calendar and all my dates creates or
updates are then messed.
ruby script/plugin install http://dhtml-calendar.googlecode.com/svn/trunk
I change not a single thing and I get this error.
I change no includes or anything.
This is crazy.
Has anyone got this error.
EG standard date enrties go through to the DB but the minute I install
DHTML calendar the updates or new creations don't work.
I tried this that is mentioned at the bottom of the following post.
http://dev.rubyonrails.org/ticket/8309
and it still does not work.
Is there anyone out there that uses PostgreSQL that has got the DHTML
calendar to work?
I hope Ed Moss is out there and may be knows what is causing this
problem.
If anyone has got this working on PostgreSQL please let me know.
Thanks
Uncle Mike
Currently the date in the DB is shown like
2007-12-31
and when I used the pop up it is also shown like 2007-12-31
This I presume is part of SQL insert as I see no INSERT command in the
log and this is above the error.
Processing CustomersController#create (for 127.0.0.1 at 2007-10-04
10:42:30) [POST]
Session ID: 3715b309d27a713eb4ea10e90b30c0f3
Parameters: {"commit"=>"Create", "action"=>"create",
"controller"=>"customers", "birthdate(1i)"=>"2007",
"lastname"=>"Soap", "firstname"=>"Joe", "birthdate(2i)"=>"10",
"birthdate(3i)"=>"4", "mobile"=>"", "fax"=>"123-122",
"town"=>"warawara", "telephone"=>"123-645",
"customer_status"=>{"id"=>"1"}, "email"=>"m...@mw.com"}}
This is the error in the log below that.
NoMethodError (undefined method `usec' for #<Date:
4908755/2,0,2299161>):
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/
active_record/connection_adapters/postgresql_adapter.rb:129:in
`quoted_date'
/vendor/plugins/dhtml_calendar/lib/extensions/active_record.rb:
42:in `quote'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/
active_record/connection_adapters/postgresql_adapter.rb:120:in
`quote'
I doubt that the official release v1.1 will have this problem fixed.
Thank you for getting back to me Ed.
I really appreciate it as I know you must be quite busy.
Regards
Uncle Mike
Big time AS fan
Sorry I forgot to mention that what is so strange is the way the SQL
insert statement is built up.
It seams to break the date up.
"birthdate(1i)"=>"2007",
"lastname"=>"Soap", "firstname"=>"Joe", "birthdate(2i)"=>"10",
"birthdate(3i)"=>"4",
As shown above.
I really want to help you to get this working as I know how many
people are using PostGreSQL and ActiveScaffold.
Thanks for the assistance.
Uncle Mike
I will look at it tonight again.
Thanks
You solved it.
I downloaded the latest svn of DHTML calendar from
http://dry.4thebusiness.com/info/dhtml_calendar
It worked first time.
Unbelievable.
Thanks, thanks, thanks.
Magic stuff.
I am so glad you have joined the AS team.
Kind regards
Uncle Mike