0

I have a Post model, and a before_save callback that calls a number of methods:

  • The first method strips html tags
  • The next makes @user's into links
  • The next makes #hashtag's into links
  • And another takes all other URLs and makes them links while reformating the link text

They are listed in that order, but for some reason it is stripping links and only saving the link text (links are handled in the last method in the chain). If I uncomment the first method then it works fine, which is just very odd!

So I was wondering if methods are called in order? If not, can I specify the order or workaround this somehow?

1
  • Code doesn't seem to be formatting correctly in my post (shows all on one line) so I have posted it here: pastie.org/8559637
    – A4J
    Dec 18, 2013 at 1:09

1 Answer 1

0

Yes, your method calls will be executed in order. The method calls are not giving you the expected result. Without seeing more code it is impossible to find a solution.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.