ormprog / rails_ama

Ruby/Rails - Ask Me Anything
MIT License
2 stars 0 forks source link

migrate factory_girl gem to factory_bot #48

Closed sadmanahmed closed 4 years ago

sadmanahmed commented 4 years ago

After executing rails db:migrate, this next line is showing but what is the reason and how can we remove it?

 sample_app git:(api) ✗ rails db:migrate       
DEPRECATION WARNING: The factory_girl gem is deprecated. Please upgrade to factory_bot. See https://github.com/thoughtbot/factory_bot/blob/v4.9.0/UPGRADE_FROM_FACTORY_GIRL.md for further instructions. (called from <main> at /home/abir/environment/sample_app/config/application.rb:7)

application.rb

require_relative 'boot'

require 'rails/all'

# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)

module SampleApp
  class Application < Rails::Application
    # Initialize configuration defaults for originally generated Rails version.
    config.load_defaults 6.0

    # Settings in config/environments/* take precedence over those specified here.
    # Application configuration can go into files in config/initializers
    # -- all .rb files in that directory are automatically loaded after loading
    # the framework and any gems in your application.
    # Include the authenticity token in remote forms.
    config.action_view.embed_authenticity_token_in_remote_forms = true
  end
end

I have this gems installed in the gemfile

gem 'factory_girl_rails'
wasifhossain commented 4 years ago

you can follow this guide and let me know if you have any issues

https://github.com/thoughtbot/factory_bot/blob/4-9-0-stable/UPGRADE_FROM_FACTORY_GIRL.md

sadmanahmed commented 4 years ago

let me check..

sadmanahmed commented 4 years ago

issue solved