Help us understand the problem. What is going on with this article?

RailsのActiveRecordにおける、日付期間の重複チェック

参考によると

比較開始日付 <= 対象終了日付 AND 比較終了日付 >= 対象開始日付

で重なっていると判断されるらしいので

matched_dates = Hoge.where('start <= ? and end >= ?', self.start, self.end)

みたいな感じにすればよい

参考:
https://qiita.com/yaju/items/a58a78f41ee41258a5fe

Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away