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.0.pre.rc7 lib/core_extensions/scenic.rb
renalware-core-2.0.0.pre.rc6 lib/core_extensions/scenic.rb
renalware-core-2.0.0.pre.rc5 lib/core_extensions/scenic.rb
renalware-core-2.0.0.pre.rc4 lib/core_extensions/scenic.rb
renalware-core-2.0.0.pre.rc3 lib/core_extensions/scenic.rb
renalware-core-2.0.0.pre.rc1 lib/core_extensions/scenic.rb
renalware-core-2.0.0.pre.beta12 lib/core_extensions/scenic.rb
renalware-core-2.0.0.pre.beta11 lib/core_extensions/scenic.rb
renalware-core-2.0.0.pre.beta10 lib/core_extensions/scenic.rb
renalware-core-2.0.0.pre.beta9 lib/core_extensions/scenic.rb
renalware-core-2.0.0.pre.beta8 lib/core_extensions/scenic.rb
renalware-core-2.0.0.pre.beta7 lib/core_extensions/scenic.rb
renalware-core-2.0.0.pre.beta6 lib/core_extensions/scenic.rb
renalware-core-2.0.0.pre.beta5 lib/core_extensions/scenic.rb
renalware-core-2.0.0.pre.beta4 lib/core_extensions/scenic.rb