Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions lib/action_tracker/base.rb
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
module ActionTracker
# nodoc
class Base
attr_reader :kontroller, :resource
attr_reader :controller, :resource
alias_method :kontroller, :controller
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it necessary ? If kontroller is going to be removed, we should expect the users to update its calls based on a version upgrade, since its well documented. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're doing a minor patch upgrade now, and is important that we maintain the compatibility within minor upgrades. Before change the public API of a class we need to WARNING in some pre-release versions and then we're good to deprecate.


def initialize(resource, kontroller)
def initialize(resource, controller)
@resource = resource
@kontroller = kontroller
init_instance_variables if kontroller
@controller = controller
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't it causes any confusion on the method lookup chain ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't figure how this can cause a confusion.

init_instance_variables if controller
end

private

def init_instance_variables
kontroller.instance_variables.each do |instance_var|
instance_variable_set(instance_var, kontroller.instance_variable_get(instance_var))
controller.instance_variables.each do |instance_var|
instance_variable_set(instance_var, controller.instance_variable_get(instance_var))
end
end
end
Expand Down