Do you think it''s necessary to use database constraints like foreign keys or it is safe to use only rails constraints like has_many and so on. -- 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.
Msan Msan wrote:> Do you think it''s necessary to use database constraints like foreign > keys or it is safe to use only rails constraints like has_many and so > on.It''s absolutely necessary to use foreign key constraints -- has_many and things like that aren''t really constraints, and anyway, they only come into play if the DB is modified through the ActiveRecord interface. To keep your data safe, you *must* use foreign key constraints. Use the Foreigner plugin to manage these constraints easily from migrations. Search the list archives for more info. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/. -- 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.
There is also foreigner gem, version 0.9.0. Is it better to use the plugin or the gem? On 28 September 2010 17:01, Marnen Laibow-Koser <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Msan Msan wrote: >> Do you think it''s necessary to use database constraints like foreign >> keys or it is safe to use only rails constraints like has_many and so >> on. > > It''s absolutely necessary to use foreign key constraints -- has_many and > things like that aren''t really constraints, and anyway, they only come > into play if the DB is modified through the ActiveRecord interface. To > keep your data safe, you *must* use foreign key constraints. Use the > Foreigner plugin to manage these constraints easily from migrations. > > Search the list archives for more info. > > Best, > -- > Marnen Laibow-Koser > http://www.marnen.org > marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org > -- > Posted via http://www.ruby-forum.com/. > > -- > 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. > >-- 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.
Please quote when replying Msan Msan wrote:> There is also foreigner gem, version 0.9.0. > Is it better to use the plugin or the gem?Most likely the gem. When I said "plugin" I meant "plugin or plugin-type gem". Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/. -- 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.