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-1.4.0 lib/tasks/pg_objects_tasks.rake
pg_objects-1.3.3 lib/tasks/pg_objects_tasks.rake
pg_objects-1.3.2 lib/tasks/pg_objects_tasks.rake
pg_objects-1.3.1 lib/tasks/pg_objects_tasks.rake
pg_objects-1.3.0 lib/tasks/pg_objects_tasks.rake
pg_objects-1.2.2 lib/tasks/pg_objects_tasks.rake
pg_objects-1.2.1 lib/tasks/pg_objects_tasks.rake
pg_objects-1.2.0 lib/tasks/pg_objects_tasks.rake
pg_objects-1.0.3 lib/tasks/pg_objects_tasks.rake
pg_objects-1.0.2 lib/tasks/pg_objects_tasks.rake
pg_objects-1.0.1 lib/tasks/pg_objects_tasks.rake
pg_objects-1.0.0 lib/tasks/pg_objects_tasks.rake
pg_objects-0.5.13 lib/tasks/pg_objects_tasks.rake
pg_objects-0.5.12 lib/tasks/pg_objects_tasks.rake
pg_objects-0.5.11 lib/tasks/pg_objects_tasks.rake
pg_objects-0.5.10 lib/tasks/pg_objects_tasks.rake
pg_objects-0.5.9 lib/tasks/pg_objects_tasks.rake
pg_objects-0.5.8 lib/tasks/pg_objects_tasks.rake
pg_objects-0.5.7 lib/tasks/pg_objects_tasks.rake
pg_objects-0.5.6 lib/tasks/pg_objects_tasks.rake