I’m getting stuck on how to count a date. I have 3 different columns:
demodate1, demodate2, demodate3
If demodate1 exists I want to count it as 1, if demodate 2 exists, I want to count it as 1, if demodate3 exists I want to count it as 1. If more than 1 of those exist I want to add them all together.
How can I do this?
Here’s my try at the code:
def demosheld
if demodate1.present? or demodate2.present? or demodate3.present?
demodate1.count + demodate2.count + demodate3.count
end
end
Edit:
Other options are