Skip to content

Commit

Permalink
use Rails.root and Rails.env for their RAILS_* counterparts are remov…
Browse files Browse the repository at this point in the history
…ed in rails3 rc.
  • Loading branch information
gugod committed Aug 17, 2010
1 parent ac8ec34 commit dc12411
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/dm-paperclip/interpolations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,19 @@ def timestamp attachment, style
def web_root attachment, style
if Object.const_defined?('Merb')
merb_root(attachment, style)
elsif Object.const_defined("RAILS_ROOT")
elsif Object.const_defined('Rails')
rails_root(attachment, style)
else
""
end
end

# Returns the RAILS_ROOT constant.
def rails_root attachment, style
Object.const_defined?('RAILS_ROOT') ? RAILS_ROOT : nil
Object.const_defined?('Rails') ? Rails.root : nil
end

# Returns the RAILS_ENV constant.
def rails_env attachment, style
Object.const_defined?('RAILS_ENV') ? RAILS_ENV : nil
Object.const_defined?('Rails') ? Rails.env : nil
end

def merb_root attachment, style
Expand Down

0 comments on commit dc12411

Please sign in to comment.