Skip to content

sprockets 3 compatibility#262

Closed
vojtad wants to merge 3 commits intoCompass:masterfrom
vojtad:fix-sprockets-3
Closed

sprockets 3 compatibility#262
vojtad wants to merge 3 commits intoCompass:masterfrom
vojtad:fix-sprockets-3

Conversation

@vojtad
Copy link
Copy Markdown
Contributor

@vojtad vojtad commented Feb 6, 2016

Sprockets 3 does not set ::Rails.application.assets when ::Rails.application.config.assets.compile is false. I have changed code to return ::Rails.application.config.assets instead. It returns correct assets paths.

I have also updated patched image_path_for_size for compass, it should work even with disabled config.assets.compile now.

When config.assets.compile is false sprockets does not set
::Rails.application.assets. Use ::Rails.application.config.assets
instead.
Use ::Rails.application.assets_manifest instead of
::Rails.application.assets when config.assets.compile is not set.
@vojtad vojtad changed the title sprocekts 3 compatibility sprockets 3 compatibility Feb 6, 2016
Comment thread lib/compass-rails.rb

def sprockets
@sprockets ||= ::Rails.application.assets
@sprockets ||= ::Rails.application.assets || ::Rails.application.config.assets
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rails.application.assets and Rails.application.config.assets are completely different things. They are not mutually interchangeable.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, however, they both respond to paths. Nevermind, I think @timhaines took a better approach at fixing this issue in #263.

@craigmcnamara
Copy link
Copy Markdown
Member

I merged #263

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants