tag: rails

  • Handling AWS Bounce Notifications from Simple Email Service
    JAN 31, 2017 Written by Don Denoncourt

    About a year ago, I had to code a Rails application to handle bounce notifications from AWS SES. Amazon Simple Email Service is ridiculously easy to configure and use in a Rails application. As the instructions at the GitHub gem page explain, all you need to do is add the aws-ses Rails gem and create a configuration file called config/initializers/amazon_ses.rb that contains your Amazon credentials (soft-coded of course). But, if you need your application to handle bounce, complaint, or delivery notifications, things get a little more complicated.

  • Embracing the Red Bar: Safely Refactoring Tests
    SEP 20, 2016 Written by M. Scott Ford

    Do you ever refactor your test code? If not, I hope you consider making this part of your normal practice. Test code is still code and should adhere to the same high standards as the code that's running directly in production. As important as it is, refactoring your test code is actually a little risky. It's very likely that you could turn a perfectly valid test into one that always passes, regardless of whether or not the code that it covers is correct. Let's explore a technique for protecting against that possibility.

  • Renaming Rails Models: A Do-Over Approach
    JUL 21, 2016 Written by Don Denoncourt

    The process of renaming models in Rails can be very error prone. To just start renaming files and changing class names and search-replace variable names is fraught with peril -- so I figured having the ability to repeat the process, in essence fix my scripting mistakes and “do-over,” was important.