Skip to content
This repository has been archived by the owner on Jul 3, 2024. It is now read-only.

Commit

Permalink
stop using alias_method_chain
Browse files Browse the repository at this point in the history
  • Loading branch information
mmoll committed Jan 7, 2018
1 parent 547cddf commit 3a2e6f1
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 20 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ Please see the Foreman manual for further instructions:
| >=1.8.1, <1.10 | 0.1.x (unmaintained) |
| >=1.10, <1.11 | 0.2.x (unmaintained) |
| >=1.11, <1.13 | 0.3.x (unmaintained) |
| >=1.13, <1.14 | 0.4.x |
| >=1.14 | 0.5.x |
| >=1.13, <1.14 | 0.4.x (unmaintained |
| >=1.14, <1.17 | 0.5.x |
| >=1.17 | 0.6.x |

## Support

Expand Down
36 changes: 19 additions & 17 deletions app/models/concerns/foreman_xen/host_helper_extensions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,29 @@ module ForemanXen
module HostHelperExtensions
extend ActiveSupport::Concern

included do
alias_method_chain :host_title_actions, :xen_snap_button
end

def host_title_actions_with_xen_snap_button(*args)
unless @host.compute_resource.nil?
if @host.compute_resource.type == 'ForemanXen::Xenserver'
title_actions(
button_group(
link_to(
_('Xen Snapshots'),
"../foreman_xen/snapshots/#{@host.id}/",
:title => _('Manage machine snapshots'),
:id => :xen_snap_button,
:class => 'btn btn-default'
module Overrides
def host_title_actions(host)
unless @host.compute_resource.nil?
if @host.compute_resource.type == 'ForemanXen::Xenserver'
title_actions(
button_group(
link_to(
_('Xen Snapshots'),
"../foreman_xen/snapshots/#{@host.id}/",
:title => _('Manage machine snapshots'),
:id => :xen_snap_button,
:class => 'btn btn-default'
)
)
)
)
end
end
super(host)
end
host_title_actions_without_xen_snap_button(*args)
end

included do
prepend Overrides
end
end
end
2 changes: 1 addition & 1 deletion lib/foreman_xen/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module ForemanXen
VERSION = '0.5.2'.freeze
VERSION = '0.6.0'.freeze
end

0 comments on commit 3a2e6f1

Please sign in to comment.