Sha256: a834138f24a1ddcca3392cebb5489c86475e2f8a1d5dd95642c58bb1023c7d8a

Contents?: true

Size: 375 Bytes

Versions: 4

Compression:

Stored size: 375 Bytes

Contents

module SimpleAdmin
  class Base < ApplicationRecord
    self.abstract_class = true
    self.table_name_prefix = 'simple_admin_'

    class << self
      def custom_model_names(namespace='SimpleAdmin')
        ApplicationRecord.descendants.map do |model|
          [model.name, model.name] unless model.name.include?(namespace)
        end.compact
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
simple-admin-0.2.0.pre.alpha app/models/simple_admin/base.rb
simple-admin-0.1.2.pre.alpha app/models/simple_admin/base.rb
simple-admin-0.1.1.pre.alpha app/models/simple_admin/base.rb
simple-admin-0.1.0.pre.alpha app/models/simple_admin/base.rb