Mazwak / active_directory

Native Ruby Access to Microsoft Active Directory
http://rubyforge.org/projects/activedirectory
GNU General Public License v3.0
16 stars 18 forks source link

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

Open freibuis opened 9 years ago

freibuis commented 9 years ago

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 commented 9 years ago

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: ''
a2f0 commented 7 years ago

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

alilland commented 7 years ago

this is still present in v1.6.1

frankschmitt commented 6 years ago

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.

tasaif commented 4 years ago

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?