Project

General

Profile

« Previous | Next » 

Revision 38964973

Added by Dominic Cleal over 6 years ago

Fixes #20957 - Replace alias_method_chain with Module prepend

Deprecated in Rails 5.0 and will be removed in 5.1. Some instances of
classes overwriting existing methods can be handled with `super`, other
concerns or modules are changed to use prepend instead of include.

Note: no ActiveSupport::Concern support for prepends, so load class
methods the pure Ruby way.

View differences:

app/models/nic/managed.rb
# this ensures we can create an interface even when there is no host queue
# e.g. outside to Host nested attributes
def queue_with_host
def queue
if host && host.respond_to?(:queue)
host.queue
else
queue_without_host
super
end
end
alias_method_chain :queue, :host
def progress_report_id
if host && host.respond_to?(:progress_report_id)

Also available in: Unified diff