aboutsummaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
authorSeb Bacon <seb.bacon@gmail.com>2011-07-07 14:04:05 +0100
committerSeb Bacon <seb.bacon@gmail.com>2011-07-07 14:04:05 +0100
commit39e04743f99ce3c88269dbf14c8790cd81e18f57 (patch)
tree0da2c176875780edf6331223582c7c9916ccd3b8 /app/models
parent3d5fc98ed1574fc05c81b0e3d86a8b81f83cc7c1 (diff)
fallbacks for public_body_categories (this needs to be done in a better way, but will do for now
Diffstat (limited to 'app/models')
-rw-r--r--app/models/public_body.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/app/models/public_body.rb b/app/models/public_body.rb
index 8c749b1df..0e32a5164 100644
--- a/app/models/public_body.rb
+++ b/app/models/public_body.rb
@@ -77,9 +77,16 @@ class PublicBody < ActiveRecord::Base
end
end
-
+ # XXX this should be saner; probably implement categories as data
+ begin
load "public_body_categories_#{I18n.locale.to_s}.rb"
-
+ rescue MissingSourceFile
+ begin
+ load "public_body_categories_#{I18n.default_locale.to_s}.rb"
+ rescue MissingSourceFile
+ load "public_body_categories.rb"
+ end
+ end
# Set the first letter, which is used for faster queries
before_save(:set_first_letter)
def set_first_letter