Sha256: 6c207092c94633ff8bbb9d7e7c932b8aee2ebd7ee33b4ef1b8157f4aa6123f83

Contents?: true

Size: 599 Bytes

Versions: 33

Compression:

Stored size: 599 Bytes

Contents

namespace :social_stream do
  namespace :avatars do
    desc "Fix avatar's attachment path from paperclip < 3.0"
    task :fix => :environment do
      dir = "#{ Rails.root }/public/system/logos/"

      Avatar.all.each do |a|
        old_logo_dir = "#{ dir }#{ a.id }/"

        old_logo_contents = Dir["#{ old_logo_dir }*"]

        new_logo_dir = "#{ Rails.root }/public#{ a.logo.to_s.split('original').first }"

        puts "Moving #{ old_logo_dir } to #{ new_logo_dir }"

        FileUtils.mkdir_p new_logo_dir
        FileUtils.mv old_logo_contents, new_logo_dir
      end
    end
  end
end

Version data entries

33 entries across 33 versions & 2 rubygems

Version Path
social_stream-1.1.12 base/lib/tasks/attachments.rake
social_stream-base-1.1.11 lib/tasks/attachments.rake
social_stream-1.1.11 base/lib/tasks/attachments.rake
social_stream-base-1.1.10 lib/tasks/attachments.rake
social_stream-1.1.10 base/lib/tasks/attachments.rake
social_stream-base-1.1.9 lib/tasks/attachments.rake
social_stream-1.1.9 base/lib/tasks/attachments.rake
social_stream-base-1.1.8 lib/tasks/attachments.rake
social_stream-1.1.8 base/lib/tasks/attachments.rake
social_stream-base-1.1.7 lib/tasks/attachments.rake
social_stream-1.1.7 base/lib/tasks/attachments.rake
social_stream-base-1.1.6 lib/tasks/attachments.rake
social_stream-1.1.6 base/lib/tasks/attachments.rake
social_stream-base-1.1.5 lib/tasks/attachments.rake
social_stream-1.1.5 base/lib/tasks/attachments.rake
social_stream-base-1.1.4 lib/tasks/attachments.rake
social_stream-1.1.4 base/lib/tasks/attachments.rake
social_stream-1.1.3 base/lib/tasks/attachments.rake
social_stream-base-1.1.3 lib/tasks/attachments.rake
social_stream-1.1.2 base/lib/tasks/attachments.rake