Ruby on Rails Tuesday, December 23, 2014

Hi,

I have a User Model which includes attributes Street, City. I want to
get array of Streets of users, when street is blank or nil i want to
pick up city of user. By searching i got to know i can get array of
streets using
User.pluck(:street), what is the query to find city of user when street
is nil.

Thanks in advance.

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/489a5f7de3aa56e0ec698017224ad786%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment