Sha256: 84c3a474a42dec8c8041bed415486bbf47e66dab05e12a891f2a81f536e7d56a
Contents?: true
Size: 604 Bytes
Versions: 7
Compression:
Stored size: 604 Bytes
Contents
module RailsAdmin module Config # Defines a visibility configuration module Hideable # Visibility defaults to true. def self.included(klass) klass.register_instance_option :visible? do !root.try :excluded? end end # Reader whether object is hidden. def hidden? !visible end # Writer to hide object. def hide(&block) visible block ? proc { instance_eval(&block) == false } : false end # Writer to show field. def show(&block) visible block || true end end end end
Version data entries
7 entries across 7 versions & 1 rubygems