Displaying 5 results from an estimated 5 matches for "mysqlcolumn".
2007 Aug 24
0
ArgumentError: interning empty string and enum-column plugin
...ng IE. enum('''',''Artist'',''Venue'',''Fan'',''Label'').
This causes the mysql_adapter.rb section of the plugin to throw a
"ArgumentError: interning empty string" error in this section of code:
[code]
class MysqlColumnWithEnum < MysqlColumn
include ActiveRecordEnumerations::Column
def initialize(name, default, sql_type = nil, null = true)
if sql_type =~ /^enum/i
values = sql_type.sub(/^enum\(''([^)]+)''\)/i,
''\1'').split("'','...
2007 Sep 03
0
Change the datatype of an attribute?
Hey everyone
I''m building an application that is using a mySQL SET datatype sad
The problem is that ActiveRecord thinks this is a date! Here''s the
relevant output from Model.columns:
#<ActiveRecord::ConnectionAdapters::MysqlColumn:0x351b488
@primary=false, @scale=nil, @sql_type="set(''Any'',''Grade School'',''High
School'',''Some College'',''Associates Degree'',''Bachelors Degree'',''Some Grad
School'','...
2006 Jul 08
1
Need Help Understanding Situation with Table Columns
...WEBrick...
=> Rails application started on http://0.0.0.0:3000
=> Ctrl-C to shutdown server; call with --help for options
#<Gmap:0x38b31a8 @attributes={"id"=>"1", "description"=>"City: Palo Alto, CA"}>
#<ActiveRecord::ConnectionAdapters::MysqlColumn:0x38bee60
@default=0,
@limit=4,
@name="type",
@null=false,
@number=true,
@primary=false,
@sql_type="tinyint(4)",
@text=false,
@type=:integer>
At first I thought I had corrupted something when I added the ''type'' column to
the gmaps table using...
2006 Sep 27
0
MySQL and Default values
...than an integer field where you
have "not null with no default". So in effort to fix this problem I have
developed the following code which I place in a file in my lib/
directory and then require it from my environment.rb.
module ActiveRecord
module ConnectionAdapters
class MysqlColumn < Column
def default
return @default if 50002 <= sprintf(''%02d%02d%02d'',
*ActiveRecord::Base.connection.send(:version)).to_i
return @default if name.to_sym == :lock_version
case type
when :integer, :float, :decimal...
2010 Dec 23
36
Weird issue with converting floats to integer
Any idea why this calculates the integer the way it does?
irb> ("291.15".to_f * 100.0).to_i
=> 29114
Thanks,
Tom
--
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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to