-
Archives
- November 2019
- February 2018
- April 2017
- October 2015
- July 2015
- May 2015
- January 2015
- August 2014
- November 2013
- September 2013
- August 2013
- July 2013
- June 2013
- March 2013
- February 2013
- November 2012
- October 2012
- August 2012
- July 2012
- November 2011
- September 2011
- August 2011
- May 2011
- January 2011
- October 2010
- May 2010
- April 2010
- October 2009
- September 2009
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
-
Meta
Category Archives: Ruby
Comments in Gemfile
I wish people would take a little time to consider the best way to arrange and comment the gem insertions in Gemfile. I am not a great fan of commenting. I believe you should code so that it is easily … Continue reading
Posted in Ruby
Comments Off on Comments in Gemfile
Initialize: keep it simple
The more objects I build, the more I am realising that I need to keep my initialize methods simple. Not doing so, leads to problems later on. The key is in the name: best practice is to keep the initialize … Continue reading
Posted in Ruby
Comments Off on Initialize: keep it simple
Do not put hyphens in engine names
I’m currently working on my first rails 3.1 engine and have just wasted a day or so because I put a hyphen in the engine name. The reason I did this was to be consistent with some other plug-ins I … Continue reading
Posted in Ruby
Comments Off on Do not put hyphens in engine names
Acts As Soft Delete By Field
I’ve had a bit of spare time recently, so I thought it was about time that I created a public gem. I thought about my code and decided that my soft delete system would be a good place to start. … Continue reading
Posted in Ruby
Comments Off on Acts As Soft Delete By Field
Model inhertiance
I’m working on an application with some CMS features. One requirement is that new content is moderated before being published. To enable this, some users are allocated as moderators. To achieve this I have a moderator status column which can … Continue reading
Posted in Ruby
Comments Off on Model inhertiance
mongrel_service on Windows 7 64bit
My current applications run on Linux in production, but I still develop on Windows PCs. My main works PC runs Windows 7 Pro 64bit. This isn’t too much of a problem. Just a couple of things don’t work (like wicked_pdf), … Continue reading
Posted in Ruby
Comments Off on mongrel_service on Windows 7 64bit
Time format
I found an interesting article by Todd Sayre on time formats in Rails. It is only short, but interesting. Based on that I created config/initializers/time_formats.rb in my latest app: # Used to create time and datetime formatting short cuts. Search … Continue reading
Posted in Ruby
Comments Off on Time format
Logging activity within a Rails application
I wanted to add a tool to log users’ activity in my current application. I wanted something simple, and decided that the solution was to combine two techniques: One: making session data available at the model and observer level. An … Continue reading
Posted in Ruby
Comments Off on Logging activity within a Rails application
attachment_fu – working with database file storage
Once I had attachment_fu working with files stored within the Rails application file system, I hit a problem as I wanted to be able to share files across three applications. The problem being that if the file was uploaded in … Continue reading
Posted in Ruby
Comments Off on attachment_fu – working with database file storage
Unit testing attachment_fu
I’m working on a portion of my latest application that will need a facility to upload files. As these files are not images, I decided to use the plug-in attachment_fu. The thing that has caused me the most head scratching … Continue reading
Posted in Ruby
Comments Off on Unit testing attachment_fu