Closed letitbe13 closed 3 years ago
But it works. I have the following code in project after save:
Rails.logger.info ">>> #{self.dmsf_files.all.size}"
After I change e.g. project's description and save the project, I can see in the log:
>>> 7
Is the observable object really Project in your case?
It works, Thank you. That was my inattention.
Hi! We all have plugins that extend behavior of standart models like Project, Issue. Is it possible to add some "plugin driven" functionality to custom_workflow scenario? For example, I have redmine_dmsf plugin. I see in _redmine_dmsf/app/models/dmsffile.rb that
and in _redmine_dmsf/app/helpres/dmsf_linkshelper.rb example of access to dmsf files from project entity:
But, when I try to add in Project after_save something like
files = self.dmsf_files
it does nothing or throw a message "undefined method dmsf_files". Now I simply want to get number of files in project dmsf, and use it in done_ratio calculation. But else I want to understand the approach, how to use plugin logic within scenarios.Thank you.