Writing a simple conditional statement in IRB

Posted by Trip on Stack Overflow See other posts from Stack Overflow or by Trip
Published on 2010-06-10T18:44:27Z Indexed on 2010/06/10 19:33 UTC
Read the original article Hit count: 221

Filed under:
|

I am looking up all Organizations with the url "http://", and updating their attributes to "".

My attempt:

Organization(:all).select { |o| o.url = "http://" ? o.update_attribute("url","")}

Which returns a compile error:

SyntaxError: compile error
 (irb):2: syntax error, unexpected '}'
   from (irb):2

Any ideas?

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about irb