@organization = Organization.where(:slug => subdomain).first
or raise ActiveRecord::RecordNotFound
SyntaxError (/Users/bmckim/Workspace/telvue/ion/app/controllers/application_controller.rb:36: syntax error, unexpected keyword_or, expecting keyword_end
or raise ActiveRecord::RecordNotFound
^):
Why does the does the “or condition” have to be on the same line as the first condition? Using parenthesis around the entire statement does not work either. The following works as expected and is arguably better anyway.
@organization = Organization.where(:slug => subdomain).first or
raise ActiveRecord::RecordNotFound
@organization = Organization.where(:slug => subdomain).firstis a complete expression on its own, so the parser thinks that’s what you meant. If Ruby had required expression terminators (semicolon, or whatever), putting theoron the second line would work.