class TranslationKey < ActiveRecord::Base has_many :key_values has_many :translation_values, :through => :key_values validates_uniqueness_of :name, :message => "already exist in another key" end class TranslationValue < ActiveRecord::Base has_many :key_values has_many :translation_keys, :through => :key_values has_many :languages validates_presence_of :text, :message => "can''t be empty" end in my update action of Key, if the key has non-valid value object I see this error message: "Translation values is invalid" why don''t I see: "already exist in another key" instead? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 7 May 2010 00:49, oren <orengolan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> in my update action of Key, if the key has non-valid value object I > see this error message: > "Translation values is invalid" > > why don''t I see: "already exist in another key" instead?Have a look at this thread from last week, which is the same question. http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/cb995e54c0fe16db/59c3189a80fb0b69 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
thanks, looking into this thread. On May 7, 5:30 am, Michael Pavling <pavl...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 7 May 2010 00:49, oren <orengo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > in my update action of Key, if the key has non-valid value object I > > see this error message: > > "Translation values is invalid" > > > why don''t I see: "already exist in another key" instead? > > Have a look at this thread from last week, which is the same question. > > http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/... > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.