Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Adding support for Rails 4 #120

Merged
merged 2 commits into from

2 participants

@smasry

No description provided.

@andi
Collaborator

Great, thanks!

@andi andi merged commit 2779687 into codeplant:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 5 deletions.
  1. +5 −5 lib/simple_navigation/adapters/rails.rb
View
10 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|
Something went wrong with that request. Please try again.