Sha256: cb85f3b99c95181e117f4654e2efb3bff95e2f3c382e155b286028ddf181196f
Contents?: true
Size: 860 Bytes
Versions: 15
Compression:
Stored size: 860 Bytes
Contents
require 'rails_admin/config/fields/group' module RailsAdmin module Config module HasGroups # Accessor for a group # # If group with given name does not yet exist it will be created. If a # block is passed it will be evaluated in the context of the group def group(name, &block) group = parent.groups.detect { |g| name == g.name } group ||= (parent.groups << RailsAdmin::Config::Fields::Group.new(self, name)).last group.tap { |g| g.section = self }.instance_eval(&block) if block group end # Reader for groups that are marked as visible def visible_groups parent.groups.collect { |f| f.section = self; f.with(bindings) }.select(&:visible?).select do |g| # rubocop:disable Style/Semicolon g.visible_fields.present? end end end end end
Version data entries
15 entries across 15 versions & 1 rubygems