I am trying to install Paperclip using Rails 6.1
I ran this command : rails g paperclip Model image
And i got this migration :
class AddAttachmentImageToExercises < ActiveRecord::Migration
def self.up
change_table :exercises do |t|
t.attachment :image
end
end
def self.down
remove_attachment :exercises, :image
end
end
But i got this error :
Caused by:
StandardError: Directly inheriting from ActiveRecord::Migration is not supported. Please specify the Rails release the migration was written for:
Then i put class AddAttachmentImageToExercises < ActiveRecord::Migration[6.1] I got this error :
ArgumentError: wrong number of arguments (given 3, expected 2)
What should i do? Thank You
Shouldn't
upanddownbe instance methods, not class methods?So removing the "self." might fix this?