I have a MySQL database with a DATE field: CREATE TABLE sales ( id int(11) NOT NULL auto_increment, ... sale_date date NOT NULL default ''2003-01-01'', PRIMARY KEY (id) ) ENGINE=MyISAM; I''ve created a validate function in my model: protected def validate errors.add(:sale_date, ''sale date cannot be later than today'') if Date.today < sale_date end All good if I am using the browser, but from my unit test, I do the following: @sale = Sale.new ... @sale.sale_date = 1.week.ago assert @sale.save And get an error that I can''t compare a Date and Time. Specifically, ArgumentError: comparison of Date with Time failed I''ve tried numerous variations on setting the date, but keep running into this type error. What am I failing to see? Thanks
or... alternatively: Date.today - 7 On 8/29/05, Ken Kunz <kennethkunz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Try: > > 1.week.ago.to_date >
I''m looking into RoR as an alternative to our PHP solutions. Our SysAdmin wanted me to ask what dependencies he might run into to remove and reinstall Ruby 1.8.2 from 1.6.8 on an RHE3 OS base? He was unable to find any RPM''s for 1.8.2 for RHE3 or TaoLinux. Thanks. Ron Phillips Internet Services Charleston Newspapers
Compile from source is what I had to do on my RHE3 server. Currently running Rails 0.12 with native mysql and fcgi. Mysql and fcgi were compiled, I didn''t look for rpms. The only problem I have is getting Rubyldap to work, it will compile but fails at runtime. - Michael On 8/31/05, Ron Phillips <ronp-TtXmYh9KqR1Wk0Htik3J/w@public.gmane.org> wrote:> I''m looking into RoR as an alternative to our PHP solutions. Our > SysAdmin wanted me to ask what dependencies he might run into to remove > and reinstall Ruby 1.8.2 from 1.6.8 on an RHE3 OS base? He was unable to > find any RPM''s for 1.8.2 for RHE3 or TaoLinux. > > Thanks. > > Ron Phillips > Internet Services > Charleston Newspapers > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
On 8/31/05, Ron Phillips <ronp-TtXmYh9KqR1Wk0Htik3J/w@public.gmane.org> wrote:> I''m looking into RoR as an alternative to our PHP solutions. Our > SysAdmin wanted me to ask what dependencies he might run into to remove > and reinstall Ruby 1.8.2 from 1.6.8 on an RHE3 OS base? He was unable to > find any RPM''s for 1.8.2 for RHE3 or TaoLinux.He could get the source RPMS from Fedora 4 for Ruby 1.8.2 and build that on the target RH system (that''s what I do for Redhat Enterprise 3).