Skip to content

Commit

Permalink
Merge branch 'rails5'
Browse files Browse the repository at this point in the history
  • Loading branch information
lizconlan committed Jun 19, 2019
2 parents 765d980 + 5d56830 commit 2de1581
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions lib/alavetelitheme.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,6 @@ def set_whatdotheyknow_view_paths
alias :set_view_paths :set_whatdotheyknow_view_paths
end

# Prepend the asset directories in this theme to the asset path:
['stylesheets', 'images', 'javascripts'].each do |asset_type|
theme_asset_path = File.join(File.dirname(__FILE__),
'..',
'app',
'assets',
asset_type)
Rails.application.config.assets.paths.unshift theme_asset_path
end

# Append individual theme assets to the asset path
theme_asset_path = File.join(File.dirname(__FILE__),
'..',
Expand All @@ -50,6 +40,22 @@ def set_whatdotheyknow_view_paths
ActiveSupport::Dependencies.autoload_once_paths.delete(path)
end

def prepend_theme_assets
# Prepend the asset directories in this theme to the asset path:
['stylesheets', 'images', 'javascripts'].each do |asset_type|
theme_asset_path = File.join(File.dirname(__FILE__),
'..',
'app',
'assets',
asset_type)
Rails.application.config.assets.paths.unshift theme_asset_path
end
end

Rails.application.config.to_prepare do
prepend_theme_assets
end

# Monkey patch app code
for patch in ['patch_mailer_paths.rb',
'controller_patches.rb',
Expand Down

0 comments on commit 2de1581

Please sign in to comment.