Permalink
Browse files

replace t.has_attached_file with t.attachment as the former is deprec…

…ated and throws a warning.
  • Loading branch information...
1 parent 5d8a132 commit 7e6b5b6f3eac48fdd1f094fb11c5336b8c43e81d @yopefonic yopefonic committed with jyurek Dec 3, 2012
Showing with 4 additions and 4 deletions.
  1. +1 −1 lib/generators/paperclip/templates/paperclip_migration.rb.erb
  2. +3 −3 test/generator_test.rb
@@ -2,7 +2,7 @@ class <%= migration_class_name %> < ActiveRecord::Migration
def self.up
change_table :<%= table_name %> do |t|
<% attachment_names.each do |attachment| -%>
- t.has_attached_file :<%= attachment %>
+ t.attachment :<%= attachment %>
<% end -%>
end
end
View
@@ -20,7 +20,7 @@ class GeneratorTest < Rails::Generators::TestCase
assert_class_method :up, migration do |up|
expected = <<-migration
change_table :users do |t|
- t.has_attached_file :avatar
+ t.attachment :avatar
end
migration
@@ -50,8 +50,8 @@ class GeneratorTest < Rails::Generators::TestCase
assert_class_method :up, migration do |up|
expected = <<-migration
change_table :users do |t|
- t.has_attached_file :avatar
- t.has_attached_file :photo
+ t.attachment :avatar
+ t.attachment :photo
end
migration

0 comments on commit 7e6b5b6

Please sign in to comment.