Allowing Unit Tests to Work as Intended
April 15th, 2012 // 11:55 am @ matt
Several months ago, I had the opportunity to improve part of a testing suite for an application I worked on. Specifically, I was improving some unit testing pertaining to the creation of DelayedJob entries when emailing users. The code being tested related to users being emailed upon registration on the site. def User < ActiveRecord::Base [...]
Read More »Creating a Custom Formtastic File Upload Input with Image Thumbnail
March 26th, 2012 // 11:50 am @ matt
Just today, I ran into a situation where I wanted to modify the output generated by Formtastic while building an input element. In this particular scenario, the input field was a file input in which the user is expected to upload an image (PNG, JPG, or GIF). The customization I wanted was the ability to [...]
Read More »Implement Multiple Table Inheritance Into Your ActiveRecord Models
March 11th, 2012 // 10:05 pm @ matt
This past week, I released my first ever Ruby gem: multiple_table_inheritance. Multiple Table Inheritance is an ActiveRecord plugin designed for Rails 3.0+ designed to make table-level inheritance easier than ever. Imagine you have an application that needs to maintain a list of employees. You’ll probably start out with a few columns including first name, last [...]
Read More »Rotating Paperclip Image Attachments in Rails
October 22nd, 2011 // 3:30 pm @ matt
With users uploading personal photos, especially ones coming their phones that capture landscape photos in portrait mode and vice versa, one of the things I wanted to integrate into Black Book Singles is the ability to rotate photos. Since I’m using the Paperclip gem, this should be relatively easy to achieve through a custom attachment [...]
Read More »Credit Where Credit Is Due
October 20th, 2011 // 6:00 pm @ matt
While I continue to work on my free online dating service (as well as the accompanying Android dating app), I delve into new territories of Ruby, Rails, and Android programming that I previously have not had to deal with. As such, I’m constantly searching for info to teach myself where to start, where to turn, [...]
Read More »Category : Blog
Tracking New User Registrations by Source & Search Terms
October 7th, 2011 // 4:38 pm @ matt
In order to better analyze my registrations, I wanted to be able to associate them with their respective traffic sources and any search terms used to find my dating service. While searching for an existing gem that takes care of this, the closest thing I could find was a plugin named search_sniffer. Unfortunately, this plugin [...]
Read More »Simple User Registration Spam Prevention in Rails 3
October 5th, 2011 // 10:42 pm @ matt
Tonight, in a little under an hour, I was able to implement spam prevention for my user registration flow thanks to the simple API provided by Stop-Registration-Spam.org. In Rails 3, creating new validators is relatively painless. Create a new validator class in a folder defined by you. For my project, I decided to place all [...]
Read More »Baker to Builder: From CakePHP to Rails
September 30th, 2011 // 12:03 pm @ matt
This past Tuesday night, I gave my first presentation for an Austin on Rails meeting. As a Ruby on Rails developer who comes from a PHP background — specifically utilizing CakePHP — I was asked to present on my experiences between the two frameworks. The presentation itself covers beginner level material. It describes my personal [...]
Read More »Category : Blog