Skip to content

Commit

Permalink
Use Rails' environment if it's present
Browse files Browse the repository at this point in the history
  • Loading branch information
Kristjan Petursson committed Apr 26, 2010
1 parent 3b7982a commit a962e71
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/modesty/frameworks/rails.rb
@@ -1,5 +1,7 @@
Modesty.root = File.join(Rails.root, 'modesty')
Modesty.config_path = File.join(Rails.root, 'config/modesty.yml')
Modesty.environment = Rails.env

Rails.configuration.after_initialize do
Modesty.load!
end
4 changes: 4 additions & 0 deletions spec/rails_spec.rb
Expand Up @@ -23,6 +23,10 @@ def self.configuration
self
end

def self.env
'test'
end

def self.after_initialize
yield
end
Expand Down

0 comments on commit a962e71

Please sign in to comment.