Displaying 2 results from an estimated 2 matches for "drop_column".
2006 Jun 23
0
help... can''t run ActiveRecord unit tests to test bug fix
...em to find the definition for #cattr_accessor which is
defined in the activesupport gem.
This is Rails 1.1.2 comprised of AR 1.14.2, ActiveSupport 1.3.1, etc.
running on OSX 10.4.6 & Ruby 1.8.4 from darwinports.
Any ideas how to get this working?
BTW, the bug in AR is in the #add_column/#drop_column methods.
Currently it isn''t handling reserved words correctly if one is used
as a column name.
Example Migration:
self.up
drop_column :some_table, :condition
end
MySQL allows the use of reserved words as column names provided they
are quoted using the backtick. This is actually...
2009 Jul 29
0
Problem uploading file to database mysql blob field
...I think is that I should add a field to "Attachments" table.*
I did this via this following migration
class AddFileToAttachments < ActiveRecord::Migration
def self.up
add_column :"attachments", :"file", :binary, :limit =>10.megabytes
end end
def self.down
drop_column :"attachments", :"file"
end
2. Now I should change the model code to copy the file content into the
blob.
I updated attachment.rb , just added the line self.file =
@temp_file.read
as I need to read the content of file and put it into database.
def file=(incoming_file)
unless...