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

Stop patching model Issue #45

Open
MayamaTakeshi opened this issue Nov 12, 2023 · 0 comments
Open

Stop patching model Issue #45

MayamaTakeshi opened this issue Nov 12, 2023 · 0 comments

Comments

@MayamaTakeshi
Copy link
Owner

Similar to #44. But I don't know yet if this can also cause conflicts.

Instead of a patch maybe we should use hooks like this:

class IssueHook < Redmine::Hook::Listener
  def controller_issues_new_after_save(context = {})
    Rails.logger.info "controller_issues_new_after_save"
    issue = context[:issue]
    unless issue.blank?
      update_custom_field(issue)
    end
  end
... ABRIDGED...
end

https://github.com/yimanishi/redmine_after_save/blob/master/lib/after_save_issue_hooks.rb

But before doing it it is better to try to reproduce a conflict (or wait someone to report it).

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