ramya
ramya

Reputation: 275

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 that I can use alias for alias method chain?

P.S: I rather not like to declare alias method chain twice for the same alias method.

Upvotes: 0

Views: 159

Answers (0)

Related Questions