Open SilasPeters opened 3 weeks ago
Given that this logic is already implemented, it would be preferable to add a helper function for this purpose. This approach avoids refactoring the existing code and mitigates the risk of breaking backward compatibility. Additionally, adding a checkbox will introduce a new column to the database, which aligns with your understanding of the issue.
However, the issue itself is somewhat ambiguous. The first sentence addresses the admin UI, while the latter part discusses code readability. Are you aiming to resolve the UI aspect, code readability, or both?
Here's a short example of how you might implement the helper function:
def open?
is_enrollable && (!open_present? || DateTime.now > when_open)
end
Currently, we do not allow creating an activity as lasting whole-day, by explicitly marking it as such. Currently, we do so by leaving the times out. However, this is a cause for ambiguity and less readable code. We should allow marking a day as whole-day with a checkbox