Open dannyy83 opened 3 years ago
Could you by chance provide a stack trace so I can more easily determine what method it's conflicting with?
Thanks!
Unfortunately there is no stack trace, just those warnings to stdout.
To give you a more concrete example:
ActiveAdmin.register Book do
state_action :review do
end
end
Warning: method `review` already defined in Admin::BooksController
This post explains the issue: https://github.com/activeadmin/activeadmin/issues/5316
However, the suggested solution does not work for me since some of my state_actions use :confirm
e.g.
ActiveAdmin.register Book do
state_action :review, confirm: -> { 'Are you sure?' } do
end
end
Thanks for providing more input on the issue, just checking in to see if you've found a work-around since we last spoke?
Otherwise I'll see what I can dig up from the linked issue and rails 6.1 (that we now support, yay with #13).
Hi @macfanatic,
I haven't found a work-around. These are just warnings printed to stderr and everything still works as intended so we are ignoring them for now... However I am afraid that future versions of rails may break.
Could you clone the repo and see if starting the rails app produces those warnings in the dummy app for you?
I do not see those logged when starting a console nor when running the server. I'm also curious if they are still present on the most recent pre-release of the library.
Hi there,
I'm using active_admin-state_machine with rails v6.1.4 and ActiveAdmin v2.9.0
When rails is launched, I get warnings for each state_action block defined in my active admin classes:
Warning: method <state action> already defined in <ActiveAdmin Controller>