Commit 7e6b5b6f by Joost Elfering Committed by Jon Yurek

replace t.has_attached_file with t.attachment as the former is deprecated and throws a warning.

parent 5d8a132a
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment