June 11, 2008 Comments Off
acts_as_confirmable is a Ruby on Rails plugin that is useful when you want to know who ticked a check box and when they did so. It can be found at http://github.com/kumo/acts_as_confirmable/tree/master. This plugin treats a datetime attribute and an integer attribute as a boolean. This boolean can then be used as normal attribute in a [...]
April 1, 2008 Comments Off
Over the next couple of posts I thought that I would like to discuss the redevelopment of my hiragana and katakana quiz software. This software originally started out as a command-line Perl script, became a PHP web script, before turning into a Ruby on Rails web application. Unfortunately, although the development language changed and possibilities [...]
February 14, 2008 Comments Off
Today after upgrading RSpec I ran a user story that I had just written and received a wonderful error: You have a nil object when you didn’t expect it! (NoMethodError). The error occurred while evaluating nil.add_scenario. I didn’t even think to check my user story because the syntax highlighting looked fine and it made sense [...]
November 23, 2006 Comments Off
I have started using the better assert_difference that was posted at blog.caboo.se to improve my rails tests. This allowed me to write tests such as: assert_difference Item, :count do Item.create(:name => “Monkey magic”) end This replaces: item_count = Item.count Item.create(:name => “Monkey magic”) assert_difference, item_count + 1, Item.count but I also wanted to be able [...]
October 12, 2006 Comments Off
I am happy to see that TheRubyMine is online (therubymine.com) and so if you are interested in the Italian Ruby and Ruby on Rails community then you should take a look and perhaps even take part.
It is still early days for them but give them some time and I am sure they will start causing trouble… hmm I hope it won’t be long before I join in with the fun!
I recently developed a “rubyonrails”:http://www.rubyonrails.org application in which a user had a province (as part of their address) and also a collection of selected provinces. class Users belongs_to :province has_and_belongs_to_many :selected_provinces, :class_name => “Province” end I could very easily find out which provinces a user had selected and also which users had selected a specific [...]