Fork me on GitHub

Check if external gem-dependent classes are defined

13 Sep 2010

Bartosz Pietrzak (bartosz@monterail.com)

How it should be done

First of all - you should setup your gems options in /config/initializers.rb, eg. in /config/initializers/calendar_date_select_options.rb

But if you really have to do it in /config/enviroment.rb...

Bad practice

CalendarDateSelect.format = :finnish

Good practice

if defined? CalendarDateSelect
  CalendarDateSelect.format = :finnish
end

This won't break others' attempt to launch rake gems:install.

Tags