condition and return != condition && return

In dealing with the wisdom of rubocop to sanitize code I ran into the following: If you write 

redirect_to_somewhere and return

then the redirect will be followed by leaving the controller method but if you change that into 

redirect_to_somewhere && return

 as per rubocop’s instructions then it fails. Odd. What exactly is the difference between the two exactly? Of course the construct looks like a frequently used Bash idiom and in this case the two statements should be just on separate lines:

redirect_to_somewhere
return

However, http://devblog.avdi.org/2010/08/02/using-and-and-or-in-ruby/ learns us that there is a difference in precedence and that we really should use the &&-operator only 

search in rails

At the moment I’m doing a Java/Spring to Ruby/RAILS conversion for a client. That is a good opportunity to weed out old stuff from the existing application and introduce new technology to replace the old architecture. After all it’s impossible to just translate everything one-on-one from the old architecture to the new one. One of the challenges is finding a suitable replacement for the lucene-based search in Spring. After a bit of searching on the internet I found that there are basically two search engines currently used in RAILS applications and that are solr and Elasticsearch. After a bit of research I also found tire which constitutes a layer between RAILS on one end and Elasticsearch. I’m currently in the process of discovering how this works. I did discover already that Elasticsearch can do proximity searches which could be a nice extension to the system I’m currently converting…