active_directory icon indicating copy to clipboard operation
active_directory copied to clipboard

undefined method `delete' for Net::LDAP::Filter

Open freibuis opened this issue 9 years ago • 5 comments

This line

options[:filter].delete(:in)

(https://github.com/Mazwak/active_directory/blob/master/lib/active_directory/base.rb#L269)

causes undefined method 'delete' for Net::LDAP::Filter if I delete this.. it seems to work (not sure what it was trying to do in the first place)

I cant find any method called delete on Net::LDAP::Filter

This is issue was introduced from 1.6.0 -> 1.6.1

freibuis avatar Jul 07 '15 13:07 freibuis

I rolled back this commit and a problems disappeared. commit 423e786f17701bc64d8b13dd2ae664bb2487837c

I am not sure wihat this commit is trying to achieve

 in => (args[1].nil?) ? '' : ( args[1][:in] || '' )

wouldnt it be better just to have

in: ''

freibuis avatar Jul 09 '15 04:07 freibuis

I can confirm that this problem exists in 1.6.1 and reverting to 1.6.0 fixes the issue.

a2f0 avatar Nov 19 '16 16:11 a2f0

this is still present in v1.6.1

alilland avatar Jun 19 '17 17:06 alilland

The sad thing is that this breaks the basic example from the docs (because find(:all) without providing any filter raises the exception), thereby greatly diminishing the usefulness of the active_directory gem.

frankschmitt avatar Oct 26 '18 20:10 frankschmitt

Comment out line 269 in ~/.rvm/gems/ruby-2.4.1/gems/active_directory-1.6.1.1/lib/active_directory/base.rb

267 :in => (args[1].nil?) ? '' : ( args[1][:in] || '' ) 268 } 269 #options[:filter].delete(:in) 270 271 cached_results = find_cached_results(args[1]) 272 return cached_results if cached_results or cached_results.nil?

tasaif avatar Feb 27 '20 21:02 tasaif