attr_bitwise
attr_bitwise copied to clipboard
Querying `any` does not returns null values
How should I do the following (using #13 as an example too) :
return all users who can see at least english and french content
user 1 => NULL
user 2 => en
I assume NULL means any cause : User.first.languages => [:en, :fr, :ca]
but : User.with_any_languages(:fr) => []
I am using the same scope :
scope :with_any_languages, lambda { |*types_sym|
where(languages_value: bitwise_union(*types_sym, 'languages'))
}
Is this intended or a bug ?
@giulioprovasi, are you sure User.first.languages returns [:en, :fr, :ca]? I'm pretty sure it returns [:en, :fr, :ca, :empty].