richardun / active_directory

Native Ruby Access to Microsoft Active Directory
http://rubyforge.org/projects/activedirectory
12 stars 8 forks source link

Hash.blank? is Rails-specific #9

Open cthielen opened 12 years ago

cthielen commented 12 years ago

Hash.blank? does not work under irb but does work under the Rails console. As far as I can tell, Rails has augmented the Hash class.

It would be nice if active_directory did not necessarily require Rails.

For example, try searching for a user, which eventually invokes this line in base.rb:246:

options = { :filter => (args[1].blank?) ? NIL_FILTER : args[1], :in => '', :attributes => Array.new }

args[1].blank? fails in irb, i.e. try {}.blank? and see what happens.

cthielen commented 12 years ago

I think one can get around this by requiring 'active_support' (https://github.com/rails/rails/blob/master/activesupport/lib/active_support/core_ext/object/blank.rb) but if so, that should be listed in the README.