mirror of https://github.com/mastodon/mastodon
Add `InetContainer` with scopes of `containing` and `contained` (#32802)
parent
df54196a14
commit
bde0f1239a
@ -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
|
Loading…
Reference in New Issue