ruby-net-ldap
ruby-net-ldap copied to clipboard
Should `Filter#==` care about the order of combined filters?
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 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.
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.
@jch I would like to work on it.
@kuldeepaggarwal :+1: that'd be awesome. Feel free to CC me on your pull request and I'll be happy to review it.
@kuldeepaggarwal friendly bump. Is there anything I can help you with here?