Skip to content

Commit

Permalink
Merge pull request #65 from abarriga/master
Browse files Browse the repository at this point in the history
Rails 5.1 fixes
  • Loading branch information
denstepa committed Aug 20, 2017
2 parents 3f4389f + 2c4861e commit ea23b6b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/mobile-fu.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ class Railtie < Rails::Railtie
initializer "mobile-fu.action_view" do |app|
ActiveSupport.on_load :action_view do
include MobileFu::Helper
alias_method_chain :stylesheet_link_tag, :mobilization
alias_method :stylesheet_link_tag_without_mobilization, :stylesheet_link_tag
alias_method :stylesheet_link_tag, :stylesheet_link_tag_with_mobilization
end
end
end
Expand Down Expand Up @@ -55,7 +56,7 @@ module ClassMethods
def has_mobile_fu(set_request_format = true)
include ActionController::MobileFu::InstanceMethods

before_filter :set_request_format if set_request_format
before_action :set_request_format if set_request_format

helper_method :is_mobile_device?
helper_method :is_tablet_device?
Expand Down Expand Up @@ -197,5 +198,6 @@ def mobile_exempt?
if Rails::VERSION::MAJOR < 3
ActionController::Base.send :include, ActionController::MobileFu
ActionView::Base.send :include, MobileFu::Helper
ActionView::Base.send :alias_method_chain, :stylesheet_link_tag, :mobilization
ActionView::Base.send :alias_method, :stylesheet_link_tag_without_mobilization, :stylesheet_link_tag
ActionView::Base.send :alias_method, :stylesheet_link_tag, :stylesheet_link_tag_with_mobilization
end

0 comments on commit ea23b6b

Please sign in to comment.