Blog Archives

Broken Arrow Keys – Ubuntu 10.10 / VMWare Fusion / Macbook Pro

Posted in Inside TFG, Tips and Tricks

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.

The arrow keys work fine now.

Reloading Factory Girl Factories in the Rails 3 Console

Posted in Inside TFG, Ruby on Rails

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.

January at The Frontier Group

Posted in Inside TFG

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!

How to Get All Associations for an Activerecord Model

Posted in Inside TFG

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 :

    Model.reflect_on_all_associations.collect{ |association|
        association.name.to_s.classify
    }

So, as usual with Rails it was easy as pie, I just am putting this here for future use :)

Edit : Thanks to Darcy for tidying up my previous mess :P

Who we work with at The Frontier Group

Posted in Inside TFG, Websites or Tools

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.

Direct Sponsorship

The Big Geekend – Website donated to host event raising money for Children’s Miracle Network

Australian Children’s Trust – Website donated and discounted hosting (new website under construction)

MosArts (Camelot Outdoor Cinema) – Free website hosting

Bletchley Park Primary School – Sponsorship of Tournament of Minds team

Breast Cancer Care WA – Cash donation

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.

Parkinsons WA – Built accessible website.

Council for a Parliament of the World’s Religions – Built web based system to organise and run worldwide conference, as well as followup development for future conferences.

West TV – 2011 Official web partner – Development on new website features in 2011.

The Green Network – 2011 Official web partner – Development of new website, launching in February 2011.

Organisations of Interest

Climate Watch

Solar Market

Looking to 2011

Drop in the bucket – Sponsorship drive

And more…

Here’s looking forward to a big year of helping out our local, national and international communities; and sharing those stories with you!

Twitter

The latest @rubyfive podcast is up, our own @sj26 receiving a mention for Ruby 1.9.3 performance improvements. http://t.co/hfx3EPMz

@frontiergroup about 1 day ago #

Search Posts

Featured Posts

Categories

Archives

View more archives