This query always returns [nil]
AdminUser.all.collect{|a|a.email}
However these two queries just work fine.
AdminUser.all
AdminUser.all.collect{|a| a.current_sign_in_ip}
Why can't i get the email addresses?
Update
The email field itself is not nil .It is present in the AdminUser.all
call and also this call retuns the correct email.
>>au=AdminUser.find(1)
>>au[:email]
=>my@email.addr
Solution to the original problem
Through another question/problem i figured out i added attr_accessor
on my :email
field in my model/admin_user.rb
i removed it and now also the
AdminUser.all.collect{|a|a.email}
query works.