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@googlegroups.com.
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.

Search Discussions

  • Oscar Del Ben at Jun 6, 2012 at 12:39 am
    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@googlegroups.com (mailto:rubyonrails-talk@googlegroups.com).
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com (mailto: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@googlegroups.com.
    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.
  • Oscar Del Ben at Jun 6, 2012 at 12:41 am
    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@googlegroups.com (mailto:rubyonrails-talk@googlegroups.com).
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com (mailto: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@googlegroups.com.
    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.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedJun 5, '12 at 8:12p
activeJun 6, '12 at 12:41a
posts3
users2
websiterubyonrails.org
irc#RubyOnRails

2 users in discussion

Oscar Del Ben: 2 posts Swati: 1 post

People

Translate

site design / logo © 2021 Grokbase