ruby-net-ldap icon indicating copy to clipboard operation
ruby-net-ldap copied to clipboard

Should `Filter#==` care about the order of combined filters?

Open Ajedi32 opened this issue 11 years ago • 5 comments

green_egg1 = Net::LDAP::Filter.equals("name", "Egg") & Net::LDAP::Filter.equals("color", "green")
green_egg2 = Net::LDAP::Filter.equals("name", "Egg") & Net::LDAP::Filter.equals("color", "green")
green_egg3 = Net::LDAP::Filter.equals("color", "green") & Net::LDAP::Filter.equals("name", "Egg")

green_egg1 == green_egg2 # => true
green_egg1 == green_egg3 # => false

This behavior seems strange to me, given that the filters green_egg1 and green_egg3 will both find the exact same set of objects in LDAP. Is there any reason why Filter#== should care about the order in which filters are combined?

Ajedi32 avatar Jun 10 '13 14:06 Ajedi32

@Ajedi32 I agree. Would you be interested in submitting a pull request to fix this? You might also be interested in https://github.com/ruby-ldap/ruby-net-ldap/issues/47.

jch avatar Oct 08 '14 13:10 jch

Again, it's been quite a while since I submitted this issue so my interest in fixing it has lessened somewhat, but if I run into this problem again I'll certainly look into fixing the problem myself and submitting a pull request.

Ajedi32 avatar Oct 09 '14 03:10 Ajedi32

@jch I would like to work on it.

kuldeepaggarwal avatar Oct 09 '14 06:10 kuldeepaggarwal

@kuldeepaggarwal :+1: that'd be awesome. Feel free to CC me on your pull request and I'll be happy to review it.

jch avatar Oct 09 '14 17:10 jch

@kuldeepaggarwal friendly bump. Is there anything I can help you with here?

jch avatar Jan 07 '15 21:01 jch