Permalink
Browse files

Changed RAILS_ENV and RAILS_ROOT to Rails.root and Rails.env

  • Loading branch information...
baumicon committed May 15, 2012
1 parent 1725de5 commit 605d880997b24306524b5d7c2fc61315e983334b
Showing with 5 additions and 5 deletions.
  1. +1 −1 lib/scribd_fu.rb
  2. +1 −1 lib/scribd_fu/attachment_fu.rb
  3. +1 −1 spec/scribd_fu_spec.rb
  4. +2 −2 spec/spec_helper.rb
View
@@ -1,6 +1,6 @@
module ScribdFu
- ConfigPath = "#{RAILS_ROOT}/config/scribd_fu.yml".freeze
+ ConfigPath = "#{Rails.root}/config/scribd_fu.yml".freeze
# A list of content types supported by iPaper.
ContentTypes = [
@@ -25,7 +25,7 @@ def file_path
if ScribdFu::amazon_based?(public_filename)
path = public_filename
else
- path = "#{RAILS_ROOT}/public#{public_filename}"
+ path = "#{Rails.root}/public#{public_filename}"
end
ScribdFu::strip_cache_string(path)
View
@@ -14,7 +14,7 @@
describe "that is missing a config file" do
before do
- File.should_receive(:file?).with("#{RAILS_ROOT}/config/scribd_fu.yml").and_return(false)
+ File.should_receive(:file?).with("#{Rails.root}/config/scribd_fu.yml").and_return(false)
end
it "should raise an error" do
View
@@ -10,10 +10,10 @@
require File.join(ROOT, 'lib', 'scribd_fu.rb')
-ENV['RAILS_ENV'] ||= 'test'
+ENV['Rails.env'] ||= 'test'
config = YAML::load(IO.read(File.dirname(__FILE__) + '/database.yml'))
-ActiveRecord::Base.establish_connection(config[ENV['RAILS_ENV'] || 'test'])
+ActiveRecord::Base.establish_connection(config[ENV['Rails.env'] || 'test'])
def rebuild_model options = {}
ActiveRecord::Base.connection.create_table :documents, :force => true do |table|

0 comments on commit 605d880

Please sign in to comment.