lib/layout/base.rb in layout-0.2.0 vs lib/layout/base.rb in layout-0.2.1

- old
+ new

@@ -26,10 +26,11 @@ end end module InstanceMethods private + def choose_layout layout_name = nil self.class.layout_options.each do |name, options| matched = options[:only] && validates_action_for_layout(true, options[:only]) || @@ -51,10 +52,10 @@ .map(&:controller_name) .find {|name| lookup_context.find_all(name, "layouts").first } || "application" end def validates_action_for_layout(compares_to, actions) - [actions].flatten.collect(&:to_sym).include?(action_name.to_sym) == compares_to + [actions].flatten.map(&:to_sym).include?(action_name.to_sym) == compares_to end end end -end \ No newline at end of file +end