ruby - Rails, calling model method in another model method -


I have a model method that translates the country code of the entire country name:

  Country country country = ISO3166 :: country [country_code] country.business [I18n.locale.to_s] || Country.name end  

Then I want to define another method in the same model that searches the full country name field. But, I have to use country_name, defined in the above model method, how can I go about calling this method?

My attempt is down, but it does not seem so ... thanks a long time ago!

  def ("summary ILIKE? Or country_name ILIKE?", "% # {Query}%", "% # {query}%")  
P>

Comments

Popular posts from this blog

c# - SignalR: "Protocol error: Unknown transport." when navigating to hub -

class - Kivy: how to instantiate a dynamic classes in python -

python - mayavi mapping a discrete colorbar on a surface -