Skip to content

Commit

Permalink
Merge f82d103 into 2b05903
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesCarscadden committed Jun 4, 2020
2 parents 2b05903 + f82d103 commit de2dd88
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
versioncake (4.0.1)
versioncake (4.0.2)
actionpack (> 5.0)
activesupport (> 5.0)
railties (> 5.0)
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails5.0.gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ..
specs:
versioncake (4.0.1)
versioncake (4.0.2)
actionpack (> 5.0)
activesupport (> 5.0)
railties (> 5.0)
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails5.2.gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ..
specs:
versioncake (4.0.1)
versioncake (4.0.2)
actionpack (> 5.0)
activesupport (> 5.0)
railties (> 5.0)
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails6.0.gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ..
specs:
versioncake (4.0.1)
versioncake (4.0.2)
actionpack (> 5.0)
activesupport (> 5.0)
railties (> 5.0)
Expand Down
4 changes: 3 additions & 1 deletion lib/versioncake.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
require 'versioncake/controller_additions'
require 'versioncake/view_additions'
require 'versioncake/engine'
require 'versioncake/railtie'
end

module VersionCake
Expand All @@ -38,4 +39,5 @@ module VersionCake
def self.setup
yield self.config
end
end
end

6 changes: 0 additions & 6 deletions lib/versioncake/controller_additions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,3 @@ def set_version(version)
end
end
end

ActionController::Base.send(:include, VersionCake::ControllerAdditions)

if defined?(ActionController::API)
ActionController::API.send(:include, VersionCake::ControllerAdditions)
end
9 changes: 9 additions & 0 deletions lib/versioncake/railtie.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
require 'rails/railtie'

class Railtie < ::Rails::Railtie
initializer :versioncake do
ActiveSupport.on_load :action_controller do
include VersionCake::ControllerAdditions
end
end
end
2 changes: 1 addition & 1 deletion lib/versioncake/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module VersionCake
VERSION = '4.0.1'
VERSION = '4.0.2'
end

0 comments on commit de2dd88

Please sign in to comment.