Hello All,
My small issue is that following rake task is printing my instance
variable to console, but I do not want any output accept my "put"
statement.
Data field is a blob and contains binary data and when printed to my
console it is huge amount of data. I dont wanna see it at all.
Any suggestions? Thanks
desc "Migrate images from attachments to fleximage."
task :migrate => [:environment] do |t|
Asset.find(:all, :conditions=>"parent_id is NULL").each do
|a|
image_file = RAILS_ROOT + "/public" + a.public_name_for
puts "Working on " + image_file
i = Image.create(
:data => image_file,
:author_id => a.author_id,
:author_ip => a.author_ip
)
ActiveRecord::Base.connection.execute("update images set id
#{a.id} where id = #{i.id}")
end
end
--
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---