Sha256: cb82ec2069a17694646a1acc3b616d24f8bd01fd4ac72995bf86b2c8f1926f97

Contents?: true

Size: 1.12 KB

Versions: 16

Compression:

Stored size: 1.12 KB

Contents

module Dummy; end

class Dummy::App < Rails::Application
  config.secret_key_base = "test"
  config.eager_load = false
  config.logger = Logger.new("/dev/stdout")

  initializer "log level" do
    Rails.logger.level = Logger::WARN
  end
end

ENV["DATABASE_URL"] = "sqlite3:tmp/test.sqlite3"

Dummy::App.initialize!

class ApplicationController < ActionController::Base
  def self.expose *methods
    methods.each do |method|
      attr_reader method
      helper_method method
    end
  end

  layout "test"

  def show
    @widget = Widget.first_or_create!
  end

  def update
    widget = Widget.first_or_create!
    widget_params = params.require(:widget).permit!
    widget.update! widget_params

    DSNode::Resource.update(params[:resources].keys, params[:resources].values) if params[:resources]

    redirect_to "/", notice: "Widget updated"
  end
end

Dummy::App.routes.draw do
  mount DSMediaLibrary::Engine => "/media_library"
  root to: "application#show"
  patch "/" => "application#update"
end

# app's soft delete leaves files in place, so clean them up
at_exit do
  begin
    Rails.public_path.rmtree
  rescue Errno::ENOENT
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
ds_media_library-0.7.2 dummy/config.rb
ds_media_library-0.7.1 dummy/config.rb
ds_media_library-0.7.0 dummy/config.rb
ds_media_library-0.6.1 dummy/config.rb
ds_media_library-0.6.0 dummy/config.rb
ds_media_library-0.5.6 dummy/config.rb
ds_media_library-0.5.5 dummy/config.rb
ds_media_library-0.5.4 dummy/config.rb
ds_media_library-0.5.3 dummy/config.rb
ds_media_library-0.5.2 dummy/config.rb
ds_media_library-0.5.1 dummy/config.rb
ds_media_library-0.5.0 dummy/config.rb
ds_media_library-0.4.0 dummy/config.rb
ds_media_library-0.3.1 dummy/config.rb
ds_media_library-0.3.0 dummy/config.rb
ds_media_library-0.2.0 dummy/config.rb