Rails Find All by Birthday: How to Find Upcoming Birthdays with ActiveRecord
There are a few ways to solve this problem. However, I think the easiest is to cache the day of the year that the user is born on as an integer. If stored alongside the timestamp we can quickly get a list but properly handle the full birthday elsewhere, s...
Written by Sean Behan on 06/17/2012
Rails Helper to Remove Leading Zero in 12 Hour Time Format
I can't find a strftime() format that will output the hour without the leading zero. For instance 6:20 will be instead 06:20. This just looks a little sloppy. I created a datetime.rb intializer which will contain custom datetime formats for my applicatio...
Written by Sean Behan on 06/17/2012
Generate MySQL Datetime Type Using PHP Date() Function
If you want to insert a datetime that matches the default mysql datetime type format use this date('Y-m-d H:i:s');
Written by Sean Behan on 06/17/2012
Date and Time Helpers in Rails
Just for reference http://api.rubyonrails.org/classes/ActionView/Helpers/DateHelper.html#M001695 This post was created about ago
Written by Sean Behan on 06/17/2012
Problem slash Bug in Rails with attr_accessor and Datetime Select Fields
Looks like there is a problem with using the attr_accessor method with datetime form fields http://dev.rubyonrails.org/ticket/8983 In Rails 2.3.2, for me at least, the problem seems to be popping up again. While trying to process a date for credit card v...
Written by Sean Behan on 06/17/2012