Find and collect map, select, inject and zip – useful Ruby methods

Today I would like to share with you some methods I have learned in Ruby. They are very cool and help a lot in resolving complex problems. #map and #map! #map and #map! transform elements of an array. In my example, it iterates over each element of my_array and multiplies it by 2 and returns a … Continue reading Find and collect map, select, inject and zip – useful Ruby methods

Advertisements

Unveiling ‘magick’ of Ruby on Rails validations

Today I learned something really usefull. I learned that validations of models in Ruby on Rails is no 'magick', as I used to think. Thanks to Andrzej Krzywda from Arkency I learned how this all works and where this all comes from. First, I visited rails'es github and took a look at the actual rails … Continue reading Unveiling ‘magick’ of Ruby on Rails validations