summaryrefslogtreecommitdiffstats
path: root/app/models
Commit message (Collapse)AuthorAgeFilesLines
* Fix slow loading of global spent time list in MySQL (#40728).Go MAEDA3 days1-6/+13
| | | | | | | | | In MySQL, the query to retrieve the global spent time list is sometimes extremely slow (taking several minutes in some environments) due to an inefficient join order chosen by the query optimizer. This patch adds an optimizer hint to improve the join order and ensure consistent performance. Patch by Go MAEDA (user:maeda). git-svn-id: https://svn.redmine.org/redmine/trunk@23609 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Improve performance of `TimeEntry#assignable_users` by reducing SQL queries ↵Go MAEDA9 days1-2/+5
| | | | | | | | | (#35927). Patch by Go MAEDA (user:maeda). git-svn-id: https://svn.redmine.org/redmine/trunk@23595 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Fixes wrong condition added in r23586 (#13596).Marius Balteanu12 days1-1/+1
| | | | git-svn-id: https://svn.redmine.org/redmine/trunk@23589 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Fixes rubocop offense "[Correctable] Lint/SafeNavigationConsistency: Use . ↵Marius Balteanu12 days1-1/+1
| | | | | | instead of unnecessary &.." (#13596). git-svn-id: https://svn.redmine.org/redmine/trunk@23588 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Add administration setting to allow time logging on closed issues. By ↵Marius Balteanu12 days2-0/+8
| | | | | | default, the setting is enabled (#13596). git-svn-id: https://svn.redmine.org/redmine/trunk@23586 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Adds missing files (#42352).Marius Balteanu2025-03-101-0/+63
| | | | | | Patch by Holger Just (user:hjust). git-svn-id: https://svn.redmine.org/redmine/trunk@23532 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Extract project query for admins to a separate ProjectAdminQuery model (#42352).Marius Balteanu2025-03-092-40/+10
| | | | | | Patch by Holger Just (user:hjust). git-svn-id: https://svn.redmine.org/redmine/trunk@23531 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Ensure that a UserQuery can only be viewed or edited by admins (#42352).Marius Balteanu2025-03-091-0/+17
| | | | | | Patch by Holger Just (user:hjust). git-svn-id: https://svn.redmine.org/redmine/trunk@23530 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Allow query class to select layout for QueriesController (#42352).Marius Balteanu2025-03-093-0/+7
| | | | | | Patch by Holger Just (user:hjust). git-svn-id: https://svn.redmine.org/redmine/trunk@23529 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Fix RuboCop Style/SuperArguments (#41884).Go MAEDA2025-02-061-1/+1
| | | | git-svn-id: https://svn.redmine.org/redmine/trunk@23491 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Reduce SQL queries triggered by `empty?` and `one?` in ↵Go MAEDA2025-01-301-1/+1
| | | | | | `TimeEntryActivity.default_activity_id` by preloading `available_activities` (#42150). git-svn-id: https://svn.redmine.org/redmine/trunk@23478 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Optimize TimeEntryActivity#default_activity_id method by introducing early ↵Go MAEDA2025-01-291-21/+21
| | | | | | | | | returns to reduce SQL queries (#42150). Patch by Go MAEDA (user:maeda). git-svn-id: https://svn.redmine.org/redmine/trunk@23477 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Refactor `Member#role_ids=` method for improved clarity and effficiency in ↵Go MAEDA2025-01-211-4/+2
| | | | | | | | | removing obsolete member roles (#42124). Patch by Go MAEDA (user:maeda). git-svn-id: https://svn.redmine.org/redmine/trunk@23451 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Optimize `Version#wiki_page` method (#42121).Go MAEDA2025-01-201-4/+1
| | | | | | | | | Avoid unnecessary evaluation of `project.wiki` when `wiki_page_title` is blank, reducing redundant SQL queries. Patch by Go MAEDA (user:maeda). git-svn-id: https://svn.redmine.org/redmine/trunk@23450 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Member roles are incorrectly added when a user's memberships are updated ↵Go MAEDA2025-01-191-1/+1
| | | | | | | | | (#42106). Patch by Thomas Löber (user:tloeber) and Mizuki ISHIKAWA (user:ishikawa999). git-svn-id: https://svn.redmine.org/redmine/trunk@23449 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Preload tracker when retrieving journal events to improve Activity view ↵Go MAEDA2025-01-181-1/+1
| | | | | | | | | performance (#42077). Patch by Go MAEDA (user:maeda). git-svn-id: https://svn.redmine.org/redmine/trunk@23447 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Optimize `journalized` method to use preloaded Issue association for better ↵Go MAEDA2025-01-181-0/+9
| | | | | | | | | Activity view performance (#42077). Patch by Go MAEDA (user:maeda). git-svn-id: https://svn.redmine.org/redmine/trunk@23446 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Fix NoMethodError in IssuePriority#high and #low when no default or active ↵Go MAEDA2025-01-051-2/+6
| | | | | | | | | priorities exist (#42066). Patch by Go MAEDA (user:maeda). git-svn-id: https://svn.redmine.org/redmine/trunk@23431 e93f8b46-1217-0410-a6f0-8f06a7374b81
* FrozenError when using SQLite3 gem version 2.0.0 or later (#41860).Go MAEDA2024-11-251-2/+1
| | | | | | | Patch by Go MAEDA (user:maeda). git-svn-id: https://svn.redmine.org/redmine/trunk@23308 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Fixes project query scope that does not take into account limit and offset ↵Marius Balteanu2024-11-231-1/+3
| | | | | | options (#41791). git-svn-id: https://svn.redmine.org/redmine/trunk@23300 e93f8b46-1217-0410-a6f0-8f06a7374b81
* @ProjectQuery#results_scope@ should return @Project::ActiveRecord_Relation@ ↵Marius Balteanu2024-11-031-2/+1
| | | | | | | | | | to keep the backward compatibility (#41678, #23954). Patch by Nishida Yuya (user:nishidayuya). git-svn-id: https://svn.redmine.org/redmine/trunk@23187 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Fix: "Import issues" and "Import time entries" pages are visible to users ↵Go MAEDA2024-11-032-2/+2
| | | | | | | | | without "Add issues" and "Log spent time" permissions (#41465). Patch by Kenta Kumojima (user:kumojima). git-svn-id: https://svn.redmine.org/redmine/trunk@23178 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Fix: `updated_by_id` in Journal points to a deleted user instead of an ↵Go MAEDA2024-10-291-0/+1
| | | | | | | | | anonymous user (#41572). Patch by Go MAEDA (user:maeda). git-svn-id: https://svn.redmine.org/redmine/trunk@23169 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Fix CSV import file encoding auto-detection failure with multibyte ↵Go MAEDA2024-10-201-1/+15
| | | | | | | | | characters (#41464). Patch by Go MAEDA (user:maeda). git-svn-id: https://svn.redmine.org/redmine/trunk@23150 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Include attachment filename in "File added" email notification subject (#41450).Go MAEDA2024-10-201-1/+4
| | | | | | | Patch by minoura makoto (user:minoura). git-svn-id: https://svn.redmine.org/redmine/trunk@23148 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Fix RuboCop offense Lint/SafeNavigationConsistency (#39887).Go MAEDA2024-10-162-2/+2
| | | | git-svn-id: https://svn.redmine.org/redmine/trunk@23134 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Replace custom email normalization logic with Rails' `normalizes` method ↵Go MAEDA2024-09-201-9/+7
| | | | | | (#29208). git-svn-id: https://svn.redmine.org/redmine/trunk@23064 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Add "Author / Previous assignee" group to assignee dropdown in issue form ↵Go MAEDA2024-09-151-0/+12
| | | | | | | | | (#16045). Patch by Luka Lüdicke (user:dkd-luedicke), Mizuki ISHIKAWA (user:ishikawa999), and Go MAEDA (user:maeda). git-svn-id: https://svn.redmine.org/redmine/trunk@23059 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Fix NoMethodError in Issue#blocked? due to invalid issue_from_id in ↵Go MAEDA2024-09-101-1/+1
| | | | | | | | | Issue#relations_from (#8539). Patch by Go MAEDA (user:maeda). git-svn-id: https://svn.redmine.org/redmine/trunk@23048 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Remove unnecessary rubocop:disable directive for Style/EmptyLiteral (#39887).Go MAEDA2024-09-051-2/+2
| | | | | | | RuboCop’s Style/EmptyLiteral false positive for `Hash.new([])` was resolved in RuboCop 1.66.1. This commit updates the RuboCop version to 1.66.1 and removes the now-unnecessary `rubocop:disable` directives. git-svn-id: https://svn.redmine.org/redmine/trunk@23013 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Fix RuboCop offense Style/StringChars (#39887).Go MAEDA2024-09-011-1/+1
| | | | git-svn-id: https://svn.redmine.org/redmine/trunk@23009 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Revert r23002 (#39887).Go MAEDA2024-09-011-2/+2
| | | | | | | | | | | | | | The change caused a test failure: ``` Failure: UserTest#test_accessing_projects_by_role_with_no_projects_should_return_an_empty_array [test/unit/user_test.rb:1048]: Expected: [] Actual: nil ``` git-svn-id: https://svn.redmine.org/redmine/trunk@23006 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Disable RuboCop Lint/InterpolationCheck for USER_FORMATS in ↵Go MAEDA2024-09-011-0/+2
| | | | | | app/models/user.rb (#39887). git-svn-id: https://svn.redmine.org/redmine/trunk@23005 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Fix RuboCop offense Style/EmptyLiteral (#39887).Go MAEDA2024-09-011-2/+2
| | | | git-svn-id: https://svn.redmine.org/redmine/trunk@23002 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Fix RuboCop offense Style/RedundantInterpolationUnfreeze (#39887).Go MAEDA2024-09-012-2/+2
| | | | | | | Since interpolated strings are always unfrozen in Ruby 3.0 and later, the use of `+""` is now redundant. git-svn-id: https://svn.redmine.org/redmine/trunk@23001 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Fix precision issues in TimeEntry#hours calculation by returning Rational ↵Go MAEDA2024-08-311-1/+8
| | | | | | | | | instead of Float (#40914). Patch by Go MAEDA (user:maeda). git-svn-id: https://svn.redmine.org/redmine/trunk@23000 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Fix RuboCop offenses Style/NegatedIf and Style/NegatedWhile (#39887, #7770).Go MAEDA2024-08-255-7/+9
| | | | git-svn-id: https://svn.redmine.org/redmine/trunk@22987 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Fix RuboCop offense Style/ClassEqualityComparison (#39887).Go MAEDA2024-08-211-1/+1
| | | | git-svn-id: https://svn.redmine.org/redmine/trunk@22978 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Introduce `active?` method to Group via Principal model (#27510).Go MAEDA2024-08-212-4/+4
| | | | | | | Patch by Go MAEDA (user:maeda). git-svn-id: https://svn.redmine.org/redmine/trunk@22976 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Add filters for "Author's group" and "Author's role" to issues list (#7867).Go MAEDA2024-08-211-0/+38
| | | | | | | Patch by Takenori TAKAKI (user:takenory). git-svn-id: https://svn.redmine.org/redmine/trunk@22975 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Use anonymous block forwarding introduced in Ruby 3.1 (#38585).Go MAEDA2024-08-215-10/+10
| | | | git-svn-id: https://svn.redmine.org/redmine/trunk@22973 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Use Array#intersect? introduced in Ruby 3.1 (#38585).Go MAEDA2024-08-206-6/+6
| | | | git-svn-id: https://svn.redmine.org/redmine/trunk@22972 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Add filters for "User's group" and "User's role" to Spent time list (#41053).Go MAEDA2024-08-161-0/+59
| | | | | | | Patch by Takenori TAKAKI (user:takenory). git-svn-id: https://svn.redmine.org/redmine/trunk@22958 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Fix RuboCop offense Layout/SpaceInsideParens, one of the offenses enabled in ↵Go MAEDA2024-08-122-2/+2
| | | | | | rubocop-rails-omakase (#39887). git-svn-id: https://svn.redmine.org/redmine/trunk@22954 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Fix RuboCop offense Layout/EmptyLinesAroundMethodBody, one of the offenses ↵Go MAEDA2024-08-121-1/+0
| | | | | | enabled in rubocop-rails-omakase (#39887). git-svn-id: https://svn.redmine.org/redmine/trunk@22950 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Fix incorrect sorting of users grouped by status in issue filters for ↵Go MAEDA2024-08-111-3/+3
| | | | | | | | | administrators (#41079). Patch by Vladislav Moiseev (user:vladdy.moses). git-svn-id: https://svn.redmine.org/redmine/trunk@22947 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Add project identifier to List-Id header in notification emails (#13359).Go MAEDA2024-07-261-3/+12
| | | | | | | Patch by Go MAEDA (user:maeda). git-svn-id: https://svn.redmine.org/redmine/trunk@22944 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Set default age parameter for User.prune method to 30 days (#41023).Go MAEDA2024-07-191-1/+1
| | | | git-svn-id: https://svn.redmine.org/redmine/trunk@22938 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Add an option to render Integer and Float custom fields with thousands ↵Go MAEDA2024-07-181-1/+7
| | | | | | | | | delimiters (#39997). Patch by Go MAEDA (user:maeda). git-svn-id: https://svn.redmine.org/redmine/trunk@22935 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Check view watchers permission when copying issues (#40946).Marius Balteanu2024-07-081-2/+2
| | | | | | | Patch by Jens Kraemer (@jkraemer). git-svn-id: https://svn.redmine.org/redmine/trunk@22914 e93f8b46-1217-0410-a6f0-8f06a7374b81