Actions
Bug #3358
closedxmera Omnia - Collection #3596: Bug fixing of several modules
Clicking on a project query resets modules and tracker to default values
Start date:
04/28/2025
Due date:
04/30/2025
% Done:
100%
Estimated time:
Description
When a user clicks on a saved project query, modules and trackers are reset to default values. The reason is unknown so far.
Updated by liaham 2 months ago
- Status changed from New to In Progress
- Start date set to 04/28/2025
- % Done changed from 0 to 20
This Rails method does not work with RM Project class due to the modified Project#initialize
method which will set some attributes to default values.
def becomes(klass)
became = klass.allocate
became.send(:initialize) do |becoming|
@attributes.reverse_merge!(becoming.instance_variable_get(:@attributes))
becoming.instance_variable_set(:@attributes, @attributes)
becoming.instance_variable_set(:@mutations_from_database, @mutations_from_database ||= nil)
becoming.instance_variable_set(:@new_record, new_record?)
becoming.instance_variable_set(:@destroyed, destroyed?)
becoming.errors.copy!(errors)
end
became
end
The idea is to write a similar method where the Project instance will be added as method param in order to get its attributes. This should prevent the attributes to be created with the default values for enabled modules, tracker and the like.
Actions