I would like to define a unique key for records based on 2 columns : \'id\' and \'language\'
to let the user submits the following strings : id=1 language=en value=bl
In Rails 5 you can do the following:
create_table :words, primary_key: %i[id language_id] do |t| t.integer :id t.integer :language_id t.string :value t.timestamps end
It is also NOT necessary to set the primary_key attribute on the Word model.
primary_key
Word