search for: string_to_d

Displaying 5 results from an estimated 5 matches for "string_to_d".

Did you mean: string_to_sid
2006 Feb 05
0
Enum patch for Rails
...integer].include? @type @@ -44,6 +44,7 @@ when :text, :string then String when :binary then String when :boolean then Object + when :enum then Symbol end end @@ -61,6 +62,7 @@ when :date then self.class.string_to_date(value) when :binary then self.class.binary_to_string(value) when :boolean then self.class.value_to_boolean(value) + when :enum then value.intern else value end end @@ -77,6 +79,7 @@ when :date then "#{self....
2006 Jan 19
0
Input date in different format
...le to enter dates in a few different formats. As well as the standard 2006-01-01 format I want to be able to enter it in m/d/yy format (eg 1/1/06 for 2006-01-01), and d mmm yy (eg 1 Jan 06). What''s the simplest way to do this? I had a go at changing ActiveRecord::ConnectionAdapters::Column.string_to_date, and that *seems* to work, but I''m not sure if it is the best way. Anyone done this or got any pointers? Cheers, -Jonny. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060119/930c353d/attach...
2010 Oct 13
10
Rails 2.3.8 - What happens to a datetime field between a form being submitted and the controller receiving the params
...end def self.down drop_table :clocks end end If I enter the date string "13/10/2010" into this field its showing up in the controller as params[:clock][:time_keeper] "2010-10-13 23:00:00 UTC". I''ve tried overloading ActiveRecord::ConnectionAdapters::Column string_to_date(string) and ActiveRecord::ConnectionAdapters::Column string_to_time(string) but these seems to get hit when an object is saved not between the form submitting and the controller receiving the params object. Where is the mysterious 23:00:00 hours coming from? Can anyone point me to a good piece...
2010 May 28
2
Suggestion for improving value_to_boolean column conversion
Hi fantastic rails core developers. Speaking of version 2.3.5: I find it rather error_prone that values such that "some text" is silently converted to false when stored in a boolean DB field. Among other things it means that assign "some text" to boolean fields on a model will not generate any validation messages (it will silently be converted to false). I think it is like
2005 Mar 03
12
bug in postgresql ''now'' time handling??
line 212 of postgresql_adapter.rb is return Time.now.to_s if value =~ /^\(''now''::text\)::(date|timestamp)/ i don''t think this will work. in postgresql the field ''now'' is pinned to the SAME TIME for the duration of a transaction. eg. if you do begin transaction; insert into t values(42, ''now''); # sleep one minute