similar to: SQLServer Timestamp parsing problem in sqlserver_adapter.rb

Displaying 20 results from an estimated 400 matches similar to: "SQLServer Timestamp parsing problem in sqlserver_adapter.rb"

2007 May 31
0
Rails AR/SQLServer Unit Test: [6912] failed (but getting better)
"bitsweat" has given AR/SQLServer some love, but it''s still unhappy... http://dev.rubyonrails.org/changeset/6912 ------------------------------------------------------------------------ r6912 | bitsweat | 2007-05-31 10:15:56 -0700 (Thu, 31 May 2007) | 1 line Fix an edge case with find with a list of ids, limit, and offset. Closes #8437.
2005 Feb 19
0
[Error] Using validates_presence_of for datetime field causes parse error?
Hi Everyone - I''ve got an odd sort of error when I try to use validates_presence_of for a MySQL ''datetime'' field. Here''s the relevant portion of the table definition: mysql> describe student_surveys; +---------------------+---------------------+------+----- +---------------------+----------------+ | Field | Type | Null |
2008 Jan 02
1
Invalid Dates in sqlserver adapter
/usr/local/lib/ruby/gems/1.8/gems/activerecord-sqlserver-adapter-1.0.0/lib/active_record/connection_adapters/sqlserver_adapter.rb" -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to
2006 Jan 28
1
Method for returning a random date between two dates
Hi, I''m trying to create a method to return a random date within a range. So far, I''ve come up with this... require ''parsedate'' def random_date (a, b) adate = ParseDate.parsedate(a) bdate = ParseDate.parsedate(b) atime = Time.local(*adate) btime = Time.local(*bdate) atime + (rand * (atime - btime) ) end ...and it doesn''t seem to
2005 Sep 06
1
US Date Handling in Rails
My application is built on Rails and MySQL. It will only be accepting US formatted dates as input, however both Rails and MySQL are oriented around ISO the format. I know I can convert a good portion of the entries using ParseDate::parsedate but it does not appear this is how the conversion is taking place when data is being transferred from the params hash into model members. Say I have a field
2006 Jul 17
18
Inserting datetime value into SQL Server
I have a SQL Server column named StartTime of (SQL Server) type datetime If I attempt to set the attribute using public def StartTime=(time) write_attribute(:StartTime, "{ts ''1899-12-30 #{time.hour}:#{time.min}:#{time.sec}''}") end it''s inserting a NULL value. Anyone else able to successfully insert a date time value into a SQL Server table using
2009 Dec 08
0
Holiday Gift Perl Script for US Holiday Dummy Regressors
##### BEGIN CODE ###### #!/usr/bin/perl ###### # # --start, -s = The date you would like to start generating regressors #--end, -e = When to stop generating holiday regressros # --scope, -c = D, W for Daily or Weekly respectively (e.g. Does this week have a particular holiday) # --file, -f = Ummm where to write the output silly! # # **NOTE** The EOM holiday is "End of Month" for
2009 Dec 08
0
Opps Correct Version of Holiday Regressor Perl Script
Here is the correct version. The old version is the redirect only version of the script. ### BEGIN SCRIPT #### #!/usr/bin/perl ###### # --start, -s = The date you would like to start generating regressors #--end, -e = When to stop generating holiday regressros # --scope, -c = D, W for Daily or Weekly respectively (e.g. Does this week have a particular holiday) # --file, -f = Ummm where to write
2006 Mar 17
0
validates_format_of before type_cast?
Often I need to do a one-off validation before Rails has had a chance to convert. For example, a date. Is there a general mechanism to cause validations to run on the raw input or do I have to resort to: private def validate unless attributes_before_type_cast[''date_of_loss''] =~ /^(\d+(-|\/)){2}\d{4}/ errors.add(''date_of_loss'', ''use the
2006 May 21
3
Using ParseDate in for loop
Hi, I''m trying to use ParseDate within a for loop but I get this error: can''t dup NilClass Any suggestions for making this work? Thanks, -Jason
2006 Feb 05
0
Enum patch for Rails
Hello! I''ve modified ActiveRecord a bit to support enum columns. This is tested only with MySQL, and maybe needs some changes for other adapters (if they use another syntax or quoting style). I believe this patch should be tested well, so I haven''t (yet) tried to post it to the official Trac. It is also not solid-as-a-rock when it comes to quoting ENUM values. After
2012 Nov 03
0
ids writer fields for HABTM relationship.
Hello forum readers, Let''s say i have two models: Person and Role (i replicated the problem with Post & Tag as well, as i thought the problem was linked to some application-specific rights problem, but it wasn''t). In Person, attr_accessible role_ids is declared, so it accepts an array of Role ids as an argument when creating / updating. If i fire up the rails console and
2006 Aug 15
2
has_many + finder_sql & :include
Hello, In a model I have: has_many :things, :finder_sql => '' select * from other_things '' + '' where id = #{id} '' When I do MyClass.find(:all, :include => :things) I get a weird error: from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/abstract_adapter.rb:120:in
2006 Jul 26
0
render :update do | page | to modify a css class string...
In my booking/_form.rhtml, I have 2 <input text fields> startingdate (selction from unobstrusive calendar ) and endingdate <div> <label for="startdate">Booking Start Date</label><br /> <%= text_field_tag(''startdate'', @startdate, {:class => @startdateclass, :readonly => "readonly", :maxlength => "25"}
2006 Jun 23
0
Multiparameter error
Hello, What''s the best way to deal with dates prior to 1970 using Rails. I''ve seen some suggestions for hacks to fallback to the Date class if Time fails, but I''m not sure exactly how to implement them. This is from the wiki require ''date'' # It''s necessary to do this, because Time doesn''t # support dates before 1970... class
2005 Dec 15
2
Migrations on SQLServer ??
Hello all, I''ve spent a while looking for a sniff of this on the wiki or google at large.. Does migrations work for SQL Server on 1.0 ? -- ------------------------------ Joyeux Noël ------------------------------ Peter Fitzgibbons _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
2006 Oct 19
3
Selecting datetime values from SQL Server (year < 1970)
All, Rails 1.1.6. Any AR find() call that generates a SELECT * type query against a table with a DATETIME column in SQL Server whose value occurs before 1970 will fail, because of the coercion of SQL Server datetime types to Time values in Ruby. See sqlserver_adapter.rb line 490 (record[col] = record[col].to_time if record[col].is_a? DBI::Timestamp) If I remove the coercion (just commenting
2007 Oct 07
0
Rails AR/Oracle Unit Test: [7769] failed (getting worse)
"bitsweat" has kicked AR/Oracle while it was down... http://dev.rubyonrails.org/changeset/7769 ------------------------------------------------------------------------ r7769 | bitsweat | 2007-10-06 22:29:37 -0700 (Sat, 06 Oct 2007) | 1 line MySQL: speedup date/time parsing. ------------------------------------------------------------------------ U
2008 Mar 19
2
ActiveRecord bug? ActiveRecord::ConnectionAdapters::Column.type_cast for float columns
Hi all, I just noticed that in ActiveRecord::ConnectionAdapters::Column.type_cast[1] (and type_cast_code[2]) the type casting for float columns simply does value.to_f, whereas all the others have a rescue or call out to a method, the default implementations of which have rescues or enough logic in that I don''t think they''d fail. Imagine the following: create_table :vehicle do
2009 Jun 09
3
NameError what is it?
I have the following code in app/controllers/processjobs_controller.rb # class ProcessJobsController <ApplicationController def index @ProcessJobs = ProcessJobs.find(:all) end end # This is my route file .. ActionController::Routing::Routes.draw do |map| map.resources :ProcessJobs map.connect '':controller/:action/:id'' map.connect