Migrating a PHP database to a new Rails application

After rewriting most of a PHP application in Ruby on Rails, I realized I had a problem with the database.  How to I get all the data from the database and put it into my rails database?  The easy answer would probably be to copy it all into the /db/seeds.rb file and just migrate.  But…

Ruby on Rails intersections of multiple arrays

finding the intersection in Ruby of 2 arrays is quite easy. If a is an array and b is an array then c can be the intersection as follows: c = a & b Similarly the union of the arrays can be found as follows: c = a | b The problem I had was…