Hi All, I have this requirement where in I am migrating data from database of one system to database of a new system. The new system is a rails app and I want my migrations to go via active record validations, however I want the callbacks to be disabled. I tried using Model.skip_callback(:save, :after, :my_callback) But this somehow does not skip the callbacks. Need help !! Thanks in advance !! -- 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.
You should be able to reopen your models and use skip_callback. Example: skip_callback :validate, :before, :save, :update, :destroy, etc -- Oscar Del Ben Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Tuesday, June 5, 2012 at 5:25 AM, swati wrote:> Hi All, > > I have this requirement where in I am migrating data from database of > one system to database of a new system. The new system is a rails app > and I want my migrations to go via active record validations, however > I want the callbacks to be disabled. I tried using > > Model.skip_callback(:save, :after, :my_callback) > > But this somehow does not skip the callbacks. Need help !! > > Thanks in advance !! > > -- > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org (mailto:rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org). > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org (mailto:rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org). > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Oh, I just realized that you tried that already, can you post some code? -- Oscar Del Ben Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Tuesday, June 5, 2012 at 5:39 PM, Oscar Del Ben wrote:> You should be able to reopen your models and use skip_callback. Example: > > skip_callback :validate, :before, :save, :update, :destroy, etc > > -- > Oscar Del Ben > Sent with Sparrow (http://www.sparrowmailapp.com/?sig) > > > On Tuesday, June 5, 2012 at 5:25 AM, swati wrote: > > > Hi All, > > > > I have this requirement where in I am migrating data from database of > > one system to database of a new system. The new system is a rails app > > and I want my migrations to go via active record validations, however > > I want the callbacks to be disabled. I tried using > > > > Model.skip_callback(:save, :after, :my_callback) > > > > But this somehow does not skip the callbacks. Need help !! > > > > Thanks in advance !! > > > > -- > > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org (mailto:rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org). > > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org (mailto:rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org). > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.