Permalink
Browse files

Merge pull request #120 from smasry/master

Adding support for Rails 4
  • Loading branch information...
2 parents 79ea081 + c7f1af0 commit 2779687167509eff524b9796a20f828a4c8cc169 @andi andi committed Jan 24, 2013
Showing with 5 additions and 5 deletions.
  1. +5 −5 lib/simple_navigation/adapters/rails.rb
@@ -49,15 +49,15 @@ def content_tag(type, content, options={})
protected
def self.rails_root
- rails3? ? ::Rails.root : ::RAILS_ROOT
+ gte_rails3? ? ::Rails.root : ::RAILS_ROOT
end
def self.rails_env
- rails3? ? ::Rails.env : ::RAILS_ENV
+ gte_rails3? ? ::Rails.env : ::RAILS_ENV
end
- def self.rails3?
- ::Rails::VERSION::MAJOR == 3
+ def self.gte_rails3?
+ ::Rails::VERSION::MAJOR >= 3
end
def template_from(controller)
@@ -82,7 +82,7 @@ def extract_controller_from(context)
end
# Initializer for Rails3
-if defined?(Rails) && Rails::VERSION::MAJOR == 3
+if defined?(Rails) && SimpleNavigation::Adapters::Rails.gte_rails3?
module SimpleNavigation
class Railtie < Rails::Railtie
initializer "simple_navigation.register" do |app|

0 comments on commit 2779687

Please sign in to comment.