]> git.openstreetmap.org Git - rails.git/blob - app/models/language.rb
Add a list of languages and fix a few issues with the schema. Also get
[rails.git] / app / models / language.rb
1 class Language < ActiveRecord::Base
2   set_primary_key :code
3
4   has_many :users, :foreign_key => 'locale'
5   has_many :diary_entries, :foreign_key => 'language'
6
7   def name
8     name = english_name
9     name += " (#{native_name})" unless native_name.nil?
10     name
11   end  
12 end