lib/active_admin/helpers/optional_display.rb in activeadmin-0.6.6 vs lib/active_admin/helpers/optional_display.rb in activeadmin-1.0.0.pre1

- old
+ new

@@ -3,14 +3,14 @@ # Shareable module to give a #display_on?(action) method # which returns true or false depending on an options hash. # # The options hash accepts: # - # :only => :index - # :only => [:index, :show] - # :except => :index - # :except => [:index, :show] + # only: :index + # only: [:index, :show] + # except: :index + # except: [:index, :show] # # call #normalize_display_options! after @options has been set # to ensure that the display options are setup correctly module OptionalDisplay @@ -18,10 +18,10 @@ return false if @options[:only] && !@options[:only].include?(action.to_sym) return false if @options[:except] && @options[:except].include?(action.to_sym) case condition = @options[:if] when Symbol, String - render_context.send condition + render_context.public_send condition when Proc render_context.instance_exec &condition else true end