Questions tagged [alias-method-chain]

18 questions
0
votes
1 answer

Alias method chain in ruby calling itself

I am rewriting the controller render method, however, I want to use the old method when in the render_to_string method. These are my current codes: def render_with_xhr(options = {}, extra_options = {}, xhr_check = true, &block) if xhr_check &&…
Jaryl
  • 2,561
  • 1
  • 24
  • 33
0
votes
0 answers

How to add alias to alias_method_chain in Ruby on Rails?

I have an alias method as: alias :is_animal , :is_animal? I am trying to declare an alias method chain for the above methods: alias_method_chain :is_animal, :with_fourlegs alias_method_chain :is_animal?, :with_fourlegs Is there any better way…
ramya
  • 275
  • 1
  • 5
  • 13
0
votes
3 answers

Alias method chain with method not defined

I have a module that gets included inside an Rails Observer. The purpose is: Call on after_save and after_update a method named check_integrity Call check_integrity at the end of after_save or/and after_updateif defined in the Observer. So in…
jrichardlai
  • 3,317
  • 4
  • 21
  • 24
1
2