Sha256: 182520dbf7f038abb0cde14d7920e7b3d36a3b26ff09fbbe08695a32abbd0a6a

Contents?: true

Size: 656 Bytes

Versions: 88

Compression:

Stored size: 656 Bytes

Contents

# frozen_string_literal: true

require_dependency "scenic"

# Override Scenic's definition#full_path so it will resolve db/views as whatever is in
# config.paths["db/views"] if present, otherwise default to the original implementation.
# Note his does not support having or merging views in both engine and the host app (as yet).
module ResolveSceneicViewsInEngineOnly
  def full_path
    app = Rails.application
    if defined?(app) && app && app.config.paths["db/views"].present?
      File.join(app.config.paths["db/views"].to_a.first, filename)
    else
      super
    end
  end
end

Scenic::Definition.send(:prepend, ResolveSceneicViewsInEngineOnly)

Version data entries

88 entries across 88 versions & 1 rubygems

Version Path
renalware-core-2.0.111 lib/core_extensions/scenic.rb
renalware-core-2.0.110 lib/core_extensions/scenic.rb
renalware-core-2.0.109 lib/core_extensions/scenic.rb
renalware-core-2.0.108 lib/core_extensions/scenic.rb
renalware-core-2.0.106 lib/core_extensions/scenic.rb
renalware-core-2.0.105 lib/core_extensions/scenic.rb
renalware-core-2.0.104 lib/core_extensions/scenic.rb
renalware-core-2.0.103 lib/core_extensions/scenic.rb
renalware-core-2.0.102 lib/core_extensions/scenic.rb
renalware-core-2.0.101 lib/core_extensions/scenic.rb
renalware-core-2.0.100 lib/core_extensions/scenic.rb
renalware-core-2.0.99 lib/core_extensions/scenic.rb
renalware-core-2.0.98 lib/core_extensions/scenic.rb
renalware-core-2.0.97 lib/core_extensions/scenic.rb
renalware-core-2.0.96 lib/core_extensions/scenic.rb
renalware-core-2.0.95 lib/core_extensions/scenic.rb
renalware-core-2.0.94 lib/core_extensions/scenic.rb
renalware-core-2.0.93 lib/core_extensions/scenic.rb
renalware-core-2.0.92 lib/core_extensions/scenic.rb
renalware-core-2.0.91 lib/core_extensions/scenic.rb