Sha256: c99734a841c98f252ccc0006e3074461f545250c5cea8b866237c59e3c1ad99a

Contents?: true

Size: 930 Bytes

Versions: 1

Compression:

Stored size: 930 Bytes

Contents

module ThecoreSettings
  module RailsAdminExtensionConfig
    def self.included(base)
      # IMPORTANT: To extend rails admin section in model, directly, instead of using concerns, I can
      # extend the included method. Be sure to use a different module name, otherwis it will be overwritten
      # See thecore_settings_rails_admin_model_extensions.rb initializer for a reference
      # on how to extend rails_admin section of a model previously defined (say it's defined in another gem)
      if base.respond_to?(:rails_admin)
        base.rails_admin do
          navigation_icon 'fa fa-cogs'
        end
      end

      def display_name
        "#{I18n.t "settings.namespaces.#{ns}", default: ns.titleize}: #{I18n.t "settings.names.#{name}", default: name.titleize}"
      end
    end
  end
end

# include the extension (loving mixins)
ThecoreSettings::Setting.send(:include, ThecoreSettings::RailsAdminExtensionConfig)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
thecore_settings-2.0.4 config/initializers/rails_admin_requirements.rb