class Menu < ActiveRecord::Base
  has_many :links, class_name: 'MenuLink'

  def self.links_for_menu_cached(menu_name)
    Rails.cache.fetch(Menu.where(name: menu_name).last.cache_key, expires_in: 24.hours) do
      Menu.where(name: menu_name).last.links.sort_by{|l| l.preferred_order}.to_a
    end
  end
end

class Menu < ActiveRecord::Base
  has_many :links, class_name: 'MenuLink'

  def self.links_for_menu_cached(menu_name)
    Rails.cache.fetch(Menu.where(name: menu_name).last, expires_in: 24.hours) do
      Menu.where(name: menu_name).last.links.sort_by{|l| l.preferred_order}.to_a
    end
  end
end

Remove unnecessary call to cache_key
Remove unnecessary call to cache_key
