Sha256: 5a82159034066a00466a7fdf4df9c1dbb474bf414310bbeb876958699e6b9a2f

Contents?: true

Size: 557 Bytes

Versions: 2

Compression:

Stored size: 557 Bytes

Contents

# frozen_string_literal: true

require "rake"
require "ts_schema"

namespace :ts_schema do
  desc "Generates a schema file in the default javascripts location, or the location specified in the ts_config initializer options"
  task generate: :environment do
    TsSchema.output_file
  end
end

namespace :db do
  def auto_generate_and_save_file
    TsSchema.output_file if TsSchema.configuration.auto_generate
  end

  task :migrate do
    at_exit { auto_generate_and_save_file }
  end

  task :setup do
    at_exit { auto_generate_and_save_file }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ts_schema-1.0.1 lib/tasks/ts_schema_tasks.rake
ts_schema-1.0.0 lib/tasks/ts_schema_tasks.rake