diff --git a/lib/redmine_dmsf/patches/project_patch.rb b/lib/redmine_dmsf/patches/project_patch.rb index 236bf499..b9caf4e6 100644 --- a/lib/redmine_dmsf/patches/project_patch.rb +++ b/lib/redmine_dmsf/patches/project_patch.rb @@ -19,6 +19,7 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# module RedmineDmsf module Patches @@ -76,10 +77,10 @@ module RedmineDmsf end def dmsf_count - file_count = DmsfFiles.where(project_id: id).all.size + - DmsfLinks.where(project_id: id, target_type: %(DmsfFile DmsfUrl)).all.size - folder_count = DmsfFolders.where(project_id: id).all.size + - DmsfLinks.where(project_id: id, target_type: 'DmsfFolder').all.size + file_count = DmsfFile.where(project_id: id).all.size + + DmsfLink.where(project_id: id, target_type: %(DmsfFile DmsfUrl)).all.size + folder_count = DmsfFolder.where(project_id: id).all.size + + DmsfLink.where(project_id: id, target_type: 'DmsfFolder').all.size { :files => file_count, :folders => folder_count } end