Some more of the user account translations. Custom generate method for languages...
[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