Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override blocks have access to the new object but not the old one #51

Closed
eturino opened this issue Mar 31, 2015 · 0 comments
Closed

Override blocks have access to the new object but not the old one #51

eturino opened this issue Mar 31, 2015 · 0 comments

Comments

@eturino
Copy link

eturino commented Mar 31, 2015

the override blocks receive as both first and second arguments the new object, instead of old_object as first argument as the doc suggests.

https://github.com/amoeba-rb/amoeba/blob/master/lib/amoeba/cloner.rb#L113

    def process_overrides
      amoeba.overrides.each do |block|
        block.call(@new_object, @new_object)
      end
    end

should be

    def process_overrides
      amoeba.overrides.each do |block|
        block.call(@old_object, @new_object)
      end
    end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant