]> git.openstreetmap.org Git - rails.git/blob - app/models/language.rb
150341cc70f50fe2e5f8398bd25cb53ba6d5f64d
[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 self.generate(code, name, translation_available)
8     Language.create do |l|
9       l.code = code
10       l.name = name
11       l.translation_available = translation_available
12     end
13   end
14 end