After installing Ubuntu 10.10 (Maverick Meerkat) in a VMWare Fusion virtual machine on a MacBook Pro, I noticed the arrow keys were broken in Ubuntu. It turned out that the Fusion install wizard had configured the keyboard to use evdev, which did not work correctly inside the VM.
The solution is to reconfigure the keyboard by running the following command:
sudo dpkg-reconfigure console-setup
To navigate the setup program without the arrow keys, I pressed the first letter of the desired option (eg. “a” for Apple Laptop), then pressed the right command key to cycle downwards through the list.
The configuration options that I chose were:
Apple Laptop for keyboard
USA as origin of keyboard
USA as keyboard layout
No AltGr
No Compose key
Enter for the rest of the defaults.
Updated : August 2011 to work with Factory Girl 2.0.5
It’s been annoying me for some time that when I hit reload! in the Rails console my factories stop working, or point to the wrong class. This wasn’t a real issue until I started using Devise.
Devise uses a mapping between classes and routes, so when a factory built object comes through to Devise after a console reload, or a class redefinition then it will fail. This is commonly the case in development and test environments.
I sat down with a colleague today (thanks Darcy) and we found the appropriate place to reload Factories to have it all work.
This is the code we put into my application.rb :
ActionDispatch::Callbacks.after do
# Reload the factories
return unless (Rails.env.development? || Rails.env.test?)
unless FactoryGirl.factories.blank? # first init will load factories, this should only run on subsequent reloads
FactoryGirl.factories.clear
FactoryGirl.find_definitions
end
end
After that everything just worked and I can hit reload! in the console without any issue.
2011 is already in full swing, so here’s a peek into some of the work we’ve been involved with so far:
We’re working with the Climate Watch project, first launching their site and now performing a series of modifications to bring more improvements to the service.
We’re expanding the Carboodle platform to sell catalogued new cars, as well as existing second hand stock.
We partnered with the Green Network and look forward to rolling out their new website in the coming weeks.
We have livened up the Ruby on Rails section of the Sitepoint blog, with a new series of posts.
We dedicated some time to our own new website, and look forward to launching that in February.
Here’s hoping February brings just as much action for our team!
There was a question that was asked on our IRC channel today about how to get all the associations for an Activerecord model. I’m assuming it was to do some debugging or something, in any case I did a bit of digging around in the Rails docs and it turns out the answer isn’t that hard.
Doing something like :
Model.reflect_on_all_associations
Will give you all the associations for that model, it’s pretty dirty though and so an easy way to tidy it up is :
As 2011 approaches, I decided to look back on a few of the great organisations we have worked with in the last 12 months. We’ve always had a soft spot for building web sites and web applications that make a difference to real people, as opposed to just solving a business need.
Here’s an overview of some of these projects from 2010.
WA Special Needs Children’s Christmas party – Cash donation
Partnerships / Organisations helped
Independent Living Centre of WA – Built and maintained web systems to help them book more appointments and serve more people in the community. Also rebuilt their website to be accessible, more useful to their audience and added an equipment supplier search feature.
Independent Living Centres Australia – Current development of the new website and the national supplier database, integrating seven state-based databases into one.