Skip to content

Commit

Permalink
replace RAILS_ENV with Rails.env
Browse files Browse the repository at this point in the history
  • Loading branch information
tsechingho committed Feb 12, 2010
1 parent eed6bb6 commit 9bf040f
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion config/initializers/footnotes.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if ENV['RAILS_ENV'] == 'development' && defined?(Footnotes)
if Rails.env == 'development' && defined?(Footnotes)
# NOT Textmate editor:
# if defined?(Footnotes)
# Footnotes::Filter.prefix = 'txmt://open?url=file://%s&line=%d&column=%d'
Expand Down
2 changes: 1 addition & 1 deletion lib/authlogic_bundle/authorization.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def permission_denied
# all rules and privilleges of each auth_dsl_file will be considered
# in controller, @authorization_engine will be used
# in model, Authorization::Engine.instance will be used
# if RAILS_ENV is development, a new Authorization::Engine.instance
# if Rails.env is development, a new Authorization::Engine.instance
# will always be created without hacking
def merge_authorization_rules
reader = ::Authorization::Reader::DSLReader.new
Expand Down
2 changes: 1 addition & 1 deletion lib/authlogic_bundle/maintenance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def delete_user_by_login(login)
end

def create_roles_from_rule_file(file=nil, skips=[:guest])
file ||= "#{RAILS_ROOT}/config/authorization_rules.rb"
file ||= "#{Rails.root}/config/authorization_rules.rb"
puts "Reading #{file} ..." if speak
reader = ::Authorization::Reader::DSLReader.load file
reader.auth_rules_reader.roles.each do |role|
Expand Down
4 changes: 2 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
# in your config/boot.rb
config.use_transactional_fixtures = true
config.use_instantiated_fixtures = false
config.fixture_path = RAILS_ROOT + '/spec/fixtures/'
config.fixture_path = Rails.root + '/spec/fixtures/'

# == Fixtures
#
Expand All @@ -46,7 +46,7 @@
#
# You can also declare which fixtures to use (for example fixtures for test/fixtures):
#
# config.fixture_path = RAILS_ROOT + '/spec/fixtures/'
# config.fixture_path = Rails.root + '/spec/fixtures/'
#
# == Mock Framework
#
Expand Down
2 changes: 1 addition & 1 deletion templates/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
def ssl_required?
return ENV['SSL'] == 'on' ? true : false if defined? ENV['SSL']
return false if local_request?
return false if RAILS_ENV == 'test'
return false if Rails.env == 'test'
super
end
CODE
Expand Down
2 changes: 1 addition & 1 deletion templates/monitor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
rake 'gems:install', :sudo => true, :env => 'development'

initializer 'footnotes.rb', <<-CODE
if ENV['RAILS_ENV'] == 'development' && defined?(Footnotes)
if Rails.env == 'development' && defined?(Footnotes)
# NOT Textmate editor:
# if defined?(Footnotes)
# Footnotes::Filter.prefix = 'txmt://open?url=file://%s&line=%d&column=%d'
Expand Down

0 comments on commit 9bf040f

Please sign in to comment.