Sha256: a65bc2eadf17aec22cf3bdbe006f9899df00246fc9e8a7deefd0b15657e45f73

Contents?: true

Size: 994 Bytes

Versions: 1

Compression:

Stored size: 994 Bytes

Contents

# require this file to load the tasks
require 'rake'

# Require sitemap_generator at runtime. If we don't do this the ActionView helpers are included
# before the Rails environment can be loaded by other Rake tasks, which causes problems
# for those tasks when rendering using ActionView.
namespace :settings do
  # Require sitemap_generator only. When installed as a plugin the require will fail, so in
  # that case, load the environment first.
  task :require do
    Rake::Task['environment'].invoke
  end

  desc "Dump settings to config/settings.yml"
  task :dump, [:as_env] => ['settings:require'] do |t, args|
    if args.empty?
      path = Settings.root_file_path.join('config/settings.yml')
    else
      path = Settings.root_file_path.join("config/settings.#{args[:as_env]}.yml")
    end
    RailsAdminSettings::Dumper.dump(path)
    puts "dumped settings to #{path}"
  end

  desc "Delete all settings"
  task :delete => ['settings:require'] do
    Settings.destroy_all!
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails_admin_settings-0.6.7 lib/rails_admin_settings/tasks.rb