Hi Peter, I think you are looking for this: http://stackoverflow.com/questions/3276110/rails-3-validation-on-uniqueness-on-multiple-attributes
It should be the same thing as Rails :). Warm regards, Ignacio El 03/11/13 23:02, Peter Booth escribió: > I have a Hobo model which represents the contents of a UK census > transcript. > I want to ensure that if I import (save) the same data from two vendors > I won’t create duplicate records. > In there words I want to crate a uniqueness constraint based on multiple > fields but not use this as an index. > > Is there a “right way” to do this with Hobo? > > > > class Transcript < ActiveRecord::Base > > hobo_model # Don't put anything above this > > fields do > piece :string > folio :string > page :string > county :string > country :string > civil_parish :string > address :string > enumeration_district :string > year :string > personas_count :integer, :default => 0, :null => false > timestamps > end > > > > -- > You received this message because you are subscribed to the Google > Groups "Hobo Users" group. > To unsubscribe from this group and stop receiving emails from it, send > an email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/hobousers. > For more options, visit https://groups.google.com/groups/opt_out. -- Ignacio Huerta Arteche http://www.ihuerta.net Teléfono: 0034 645 70 77 35 Email realizado con software libre -- You received this message because you are subscribed to the Google Groups "Hobo Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/hobousers. For more options, visit https://groups.google.com/groups/opt_out.
