Sha256: dbd5622ea2b16b1efb69e989a86842df6aed2e3340d80fa94ea2b43309f0af32

Contents?: true

Size: 566 Bytes

Versions: 28

Compression:

Stored size: 566 Bytes

Contents

namespace :db do
  namespace :create_objects do
    desc 'Create all the database objects from "before" folder'
    task before: :environment do
      PgObjects::Manager.new.load_files(:before).create_objects
    end

    desc 'Create all the database objects from "after" folder'
    task after: :environment do
      PgObjects::Manager.new.load_files(:after).create_objects
    end
  end
end

require 'rake/hooks'

before 'db:migrate' do
  Rake::Task['db:create_objects:before'].invoke
end

after 'db:migrate' do
  Rake::Task['db:create_objects:after'].invoke
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
pg_objects-0.5.5 lib/tasks/pg_objects_tasks.rake
pg_objects-0.5.4 lib/tasks/pg_objects_tasks.rake
pg_objects-0.5.3 lib/tasks/pg_objects_tasks.rake
pg_objects-0.5.2 lib/tasks/pg_objects_tasks.rake
pg_objects-0.4.4 lib/tasks/pg_objects_tasks.rake
pg_objects-0.4.3 lib/tasks/pg_objects_tasks.rake
pg_objects-0.4.2 lib/tasks/pg_objects_tasks.rake
pg_objects-0.3.4 lib/tasks/pg_objects_tasks.rake