Skip to content

Commit

Permalink
move asset_sync require to the earliest point possible
Browse files Browse the repository at this point in the history
  • Loading branch information
jhass committed Jun 13, 2013
1 parent dfef6ee commit c6d158b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
* Fix posting to Twitter [#2758](https://github.com/diaspora/diaspora/issues/2758)
* Don't show hovercards for current user in comments [#3999](https://github.com/diaspora/diaspora/issues/3999)
* Replace mentions of out-of-aspect people with markdown links [#4161](https://github.com/diaspora/diaspora/pull/4161)
* Unify hide and ignore [#3828](https://github.com/diaspora/diaspora/issues/3828)
* Unify hide and ignore [#3827](https://github.com/diaspora/diaspora/issues/3828)
* Remove alpha branding [#4196](https://github.com/diaspora/diaspora/issues/4196)
* Fix dynamic loading of asset_sync

## Features

Expand Down
3 changes: 3 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
require 'rails/all'
Bundler.require(*Rails.groups(:assets => %w(development test))) if defined?(Bundler)

# Load asset_sync early
require_relative 'asset_sync'

module Diaspora
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
Expand Down
11 changes: 11 additions & 0 deletions config/asset_sync.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
if AppConfig.environment.assets.upload? && AppConfig.environment.s3.enable?
# Monkey patch to make Rails.root available early
require 'pathname'
module Rails
def self.root
@@root ||= Pathname.new(__FILE__).dirname.join('..')
end
end

require 'asset_sync'
end
4 changes: 1 addition & 3 deletions config/initializers/asset_sync.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@

if AppConfig.environment.assets.upload? && AppConfig.environment.s3.enable?
require 'asset_sync'
if defined? AssetSync
AssetSync.configure do |config|
config.enabled = true

Expand Down

0 comments on commit c6d158b

Please sign in to comment.