Sha256: 7129c8d4c49f84eff9989ea1e6361e9bae5c5d2e51a3f0ba3111efbff79619d0

Contents?: true

Size: 625 Bytes

Versions: 35

Compression:

Stored size: 625 Bytes

Contents

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

35 entries across 35 versions & 1 rubygems

Version Path
renalware-core-2.0.16 lib/core_extensions/scenic.rb
renalware-core-2.0.15 lib/core_extensions/scenic.rb
renalware-core-2.0.14 lib/core_extensions/scenic.rb
renalware-core-2.0.13 lib/core_extensions/scenic.rb
renalware-core-2.0.12 lib/core_extensions/scenic.rb
renalware-core-2.0.11 lib/core_extensions/scenic.rb
renalware-core-2.0.9 lib/core_extensions/scenic.rb
renalware-core-2.0.8 lib/core_extensions/scenic.rb
renalware-core-2.0.7 lib/core_extensions/scenic.rb
renalware-core-2.0.5 lib/core_extensions/scenic.rb
renalware-core-2.0.4 lib/core_extensions/scenic.rb
renalware-core-2.0.3 lib/core_extensions/scenic.rb
renalware-core-2.0.2 lib/core_extensions/scenic.rb
renalware-core-2.0.1 lib/core_extensions/scenic.rb
renalware-core-2.0.0 lib/core_extensions/scenic.rb
renalware-core-2.0.0.pre.rc13 lib/core_extensions/scenic.rb
renalware-core-2.0.0.pre.rc11 lib/core_extensions/scenic.rb
renalware-core-2.0.0.pre.rc10 lib/core_extensions/scenic.rb
renalware-core-2.0.0.pre.rc9 lib/core_extensions/scenic.rb
renalware-core-2.0.0.pre.rc8 lib/core_extensions/scenic.rb