Skip to content

Commit

Permalink
using ::AS::Dependencies everywhere.
Browse files Browse the repository at this point in the history
  • Loading branch information
apotonick committed Jun 29, 2011
1 parent 594ce6f commit 5e9b479
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions rails/init.rb
Expand Up @@ -5,10 +5,12 @@
#
# * +app/cells+
#
if ::ActiveSupport::Dependencies.respond_to?(:autoload_paths)
ActiveSupport::Dependencies.autoload_paths << Rails.root.join(*%w[app cells])
dep = ::ActiveSupport::Dependencies

if dep.respond_to?(:autoload_paths)
dep.autoload_paths << Rails.root.join(*%w[app cells])
else
ActiveSupport::Dependencies.load_paths << Rails.root.join(*%w[app cells])
dep.load_paths << Rails.root.join(*%w[app cells])
end

# Rails initialization hook.
Expand All @@ -20,23 +22,23 @@
if plugin.engine? && File.exists?(engine_cells_dir)
# propagate the view- and code path of this engine-cell:
::Cell::Base.view_paths << engine_cells_dir
if ::ActiveSupport::Dependencies.respond_to?(:autoload_paths)
::ActiveSupport::Dependencies.autoload_paths << engine_cells_dir
if dep.respond_to?(:autoload_paths)
dep.autoload_paths << engine_cells_dir
else
::ActiveSupport::Dependencies.load_paths << engine_cells_dir
dep.load_paths << engine_cells_dir
end

# if a path is in +load_once_path+ it won't be reloaded between requests.
unless config.reload_plugins?
if ::ActiveSupport::Dependencies.respond_to?(:autoload_once_paths)
::ActiveSupport::Dependencies.autoload_once_paths << engine_cells_dir
if dep.respond_to?(:autoload_once_paths)
dep.autoload_once_paths << engine_cells_dir
else
::ActiveSupport::Dependencies.load_once_paths << engine_cells_dir
dep.load_once_paths << engine_cells_dir
end
end
end
end
end
else
puts "[cells:] NOTE: Rails environment not available. Running isolated."
end
end

0 comments on commit 5e9b479

Please sign in to comment.