2
0

Add InetContainer with scopes of containing and contained (#32802)

This commit is contained in:
Matt Jankowski
2024-11-08 05:08:36 -05:00
committed by GitHub
parent df54196a14
commit bde0f1239a
7 changed files with 18 additions and 6 deletions

View File

@@ -0,0 +1,10 @@
# frozen_string_literal: true
module InetContainer
extend ActiveSupport::Concern
included do
scope :containing, ->(value) { where('ip >>= ?', value) }
scope :contained_by, ->(value) { where('ip <<= ?', value) }
end
end