-
Notifications
You must be signed in to change notification settings - Fork 68
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
Passing params into the amoeba function? #112
Comments
+1 i'd love this feature too! to keep your example, i think it would be reasonable to have a feature like that: class Game
has_many :reviews
amoeba do |arg|
set :day => arg
end
end
class Review
amoeba do |arg|
set :some_field => arg
end
end and then beeing able to call my_game.amoeba_dup(17)
#=> results in game with day: 17 and a review with some_field: 17 |
Hi. Sorry for the long delay in responding to this. I am not the original creator of this gem. Rather, I just happen to be the last person to have touched it and have managed to get admin access to it. I have a vested interested in keeping it alive as I work on a project that depends on it. In an attempt to resurrect it I am looking to work on some features and, I hope, get some activity from others. Are you still around and interested in this feature? I have created a PR (#128) that, if I understand the problem correctly, will give the desired result although it does not work quite in the way suggested above. I would appreciate a review of the code, if you have the time. |
I need to copy objects, but with input params.
Specific example
needs to become
On the inside amoeba func, there is lambda function, that allows to change all fields, but is there a way to pass "new day of the game" inside lambda or amoeba to make those changes?
I know I accomplish it with update record after copy is created, but it will not affect nested associations, that will also be copied with amoeba. The idea is to successively pass params into next associated records, to update-copy all nested records.
The text was updated successfully, but these errors were encountered: