Strange output when invoking model method from a runner in Rails -


i'm invoking model method runner:

rails runner -e development "sala.new.recipient_list2" 

model method:

def recipient_list2   email_list = sala.all(email)   email_list.each |recipient|     puts "#{recipient}"   end end  

and i'm getting following output:

#<sala:0xb05665c> #<sala:0xb055770> #<sala:0xb05566c> #<sala:0xb055568> #<sala:0xb055464> #<sala:0xb055360> #<sala:0xb05525c> #<sala:0xb055158> #<sala:0xb055054> #<sala:0xb054f50> #<sala:0xb054e4c> #<sala:0xb054d48> #<sala:0xb054c44> #<sala:0xb054b40> #<sala:0xb054a3c> 

if call modified version of method looks controller:

def recipient_list   email_list = sala.all(email) end  

controller call:

@list = to_be_notified.recipient_list 

and display @list in view, list of emails.

why isn't working runner ? !

add .email in recipient_list2 meth

  email_list.each |recipient|     puts "#{recipient.email}"   end 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -