When I first saw it, I thought it was a mistake in the description. When I asked the mentor, I hadn't seen it at first. I was told! I looked it up and learned that this is an object.
Below is the code in question.
date: @todays_date..@todays_date + 6)
This is a 2-point dot, but there are also 3-point dots.
It's called ** range object **. It seems to be used when saving to SQL ・ Low code and high readability ・ Less likely to cause an error It seems to have the above merits.
rails
User.where(age: ...30)
The above code
SQL
SELECT "users".* FROM "users" WHERE "users"."age" < 30
Certainly it will be shorter.
The code at the beginning is called ** Between **. Simply put, it feels like the value on the left to the value on the right!
I referred to the following page. If you are interested, please take a look!
[Rails] How to write ActiveRecord where comparison and range search code using range object (Range) https://simple-minds-think-alike.hatenablog.com/entry/active-record-where-with-range