Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document use with standalone-migrations #146

Open
dmolesUC opened this issue Feb 12, 2020 · 0 comments
Open

Document use with standalone-migrations #146

dmolesUC opened this issue Feb 12, 2020 · 0 comments

Comments

@dmolesUC
Copy link

dmolesUC commented Feb 12, 2020

Just FYI, I was able to use this gem outside of Rails with standalone-migrations, although I had to jump through a few hoops to create my own Rake task and make my model classes available to it. In case you want to document it (or in case anyone is looking for it in the issues), here's the relevant part of my Rakefile:

$LOAD_PATH.unshift(File.expand_path('app/models', __dir__))
Dir.glob(File.expand_path('app/models/*.rb', __dir__)).sort.each(&method(:require))
require 'seed_dump'

namespace :db do
  namespace :seed  do
    desc "Dump records from the database into db/seeds.rb"
    task :dump => :environment do
      SeedDump.dump_using_environment(ENV)
    end
  end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant