Skip to content

Commit

Permalink
Clearing Deprecation Notices:
Browse files Browse the repository at this point in the history
DEPRECATION WARNING: require "activerecord" is deprecated and will be removed
in Rails 3. Use require "active_record" instead. (called from <top (required)>
at gems/activerecord-2.3.9/lib/activerecord.rb:2)

DEPRECATION WARNING: ActiveSupport::Dependencies.load_paths is deprecated,
please use autoload_paths instead. (called from block in <top (required)> at
apn_on_rails/lib/apn_on_rails/apn_on_rails.rb:61)

DEPRECATION WARNING: ActiveSupport::Dependencies.load_once_paths is deprecated
and removed in Rails 3, please use autoload_once_paths instead. (called from
block in <top (required)> at apn_on_rails/lib/apn_on_rails/apn_on_rails.rb:62)
  • Loading branch information
cqr committed Oct 6, 2010
1 parent f94d0b3 commit ae5a133
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ group :development do
gem "jeweler", "~> 1.5.0.pre2"
gem "rcov", ">= 0"
gem "actionpack", '~> 2.3.8'
gem 'activerecord', "~> 2.3.8"
gem 'activerecord', "~> 2.3.8", :require => 'active_record'
end
11 changes: 8 additions & 3 deletions lib/apn_on_rails/apn_on_rails.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,14 @@ def initialize(message) # :nodoc:
path = File.join(File.dirname(__FILE__), 'app', dir)
$LOAD_PATH << path
# puts "Adding #{path}"
begin
ActiveSupport::Dependencies.load_paths << path
ActiveSupport::Dependencies.load_once_paths.delete(path)
begin
if ActiveSupport::Dependencies.respond_to? :autoload_paths
ActiveSupport::Dependencies.autoload_paths << path
ActiveSupport::Dependencies.autoload_once_paths.delete(path)
else
ActiveSupport::Dependencies.load_paths << path
ActiveSupport::Dependencies.load_once_paths.delete(path)
end
rescue NameError
Dependencies.load_paths << path
Dependencies.load_once_paths.delete(path)
Expand Down
2 changes: 1 addition & 1 deletion spec/active_record/setup_ar.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require 'rubygems'
require 'activerecord'
require 'active_record'

logger = Logger.new(STDOUT)
logger.level = Logger::INFO
Expand Down

0 comments on commit ae5a133

Please sign in to comment.