Skip to main content

Rails

Using Rails Resolver Api
·392 words·2 mins
Yesterday at work, we decided to improve our user experience in web mobile. We decided it was time to create a different view for each action. In Rails 4 there is this really cool feature called Variants
Self-referential Associations in Rails
·273 words·2 mins
When I first heard about this concept, I needed clarification. I was reading Learn Rails by Example by Michael Hart The concept was too complex to understand by then, so I researched. I found the Railscast episode Self-referential Associations, which shed some light on the concept.
Delayed job, Heroku and sending an email with attachments
·465 words·3 mins
Rails make it extremely easy to send emails. I’m not going to explain how to do it; there are pretty good tutorials around the internet, this one is well explained: Action Mailer Basics.
Rails and select
·210 words·1 min
In a rails project I’m working on, I was trying to select from the database some sales with some conditions. Here is the Sale model: class Sale < ActiveRecord::Base belongs_to :voucher belongs_to :client has_many :line_items, dependent: :destroy has_many :bills end So the goal of the task was to obtain all the Sales where the LineItems has express_checkout set it to true.