Closed luchotc closed 3 years ago
First of all I'm introducing optional start_date and end_date for CertificatePrograms and I renamed start_date and end_date of Certificates to started_at and ended_at because I think it is more semantic this way and to avoid attribute name repetition and make it clearer.
I understand the need of having two different pair of dates, and I am ok with that. However I don't understand how those names are more intention revealing. For me started_at
and start_date
mean exactly the same. Is there a convention I am not getting? Could you explain please? Thanks!
@flbulgarelli Approved this one verbally
:memo: Details
There are several little changes in this one.
First of all I'm introducing optional
start_date
andend_date
forCertificateProgram
s and I renamedstart_date
andend_date
ofCertificate
s tostarted_at
andended_at
because I think it is more semantic this way and to avoid attribute name repetition and make it clearer. For aCertificate
,started_at
andended_at
represent the dates in which thecertified student
actually completed the program. For aCertificateProgram
,start_date
andend_date
are optional and they only represent the start and end date of the whole program. A program without start_date means that it is ongoing since the moment it was created and without end_date means that it could be ongoing forever. Ideally each program should have a clear start and end, but I'm considering those cases just in case.I've created a method in
application_record
for easily creating a scope which filters between two optional dates and allow it to receive a param to specify if the filter should be actually applied or not.So
CertificateProgram.active(false)
won't actually filter anything, which may be useful in the future :smile:.I've also added the ability for an
organization
to know if there is anyongoing_certificate_programs?
there. My idea is to showMy certificates
section only if there are ongoing_certificate_programs or the user was certified in that organization in the past. My intuition is that adding a section for something that you can't obtain, like a certificate it's not ideal. To discuss with @aguspina @lauramangifesta and @felipecalvo:warning: Dependencies
None
:back: Backwards compatibility
100%