I have been using Vagrant for a while now. Overall I am very satisfied with the simplicity of it and the way it can standardize environments when it comes to collaborating with others. In my bigger projects I usually setup a
Vagrantfile.example with all the default settings that I commit to the git repository and then I add an exception for the Vagrantfile itself to allow for personal customization if that would be needed.
UPDATE 2018! Paperclip is deprecated
I recently went about cleaning up some of my earlier “syntax mistakes” in a Ruby project of mine. So what do I mean by syntax mistake? It is a term I use to define something that works perfectly fine, but leaves you with that feeling of “shouldn’t there be a nicer way of writing this?”. I think you know the feeling.
When it comes to working with a mix of values or variables, and I want to treat them as an array, I am in the habit of using the
Array(...) method to make sure I am always working with an array, without having to explicitly check for a nil or non-array values. What this method does is that it tries to call first
#to_a on the passed argument.
I have written before about the method
find_or_create_by, so what is different about this new addition and why is it needed?