Use a block to add the language record as rails seems to ignore any
attempt to set the primary key in the argument list of the create method.
This commit is contained in:
parent
0e71278320
commit
ded669bb4d
1 changed files with 5 additions and 1 deletions
|
@ -10,7 +10,11 @@ class CreateLanguages < ActiveRecord::Migration
|
|||
|
||||
add_primary_key :languages, [:code]
|
||||
|
||||
Language.create(:code => 'en', :name => 'English', :translation_available => true)
|
||||
Language.create do |l|
|
||||
l.code = 'en'
|
||||
l.name = 'English'
|
||||
l.translation_available = true
|
||||
end
|
||||
|
||||
add_foreign_key :users, [:locale], :languages, [:code]
|
||||
add_foreign_key :diary_entries, [:language], :languages, [:code]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue