Class: Madmin::StaticModels::Adapter

Inherits:
Object
  • Object
show all
Defined in:
lib/madmin/static_models/adapter.rb

Overview

Base class for static model backends. An adapter declares which model classes it manages and how to introspect them. Register one with:

Madmin::StaticModels.register(MyAdapter)

Class Method Summary collapse

Class Method Details

.column_names(model) ⇒ Object

Ordered attribute names (strings) for the model, primary key first.



14
15
16
# File 'lib/madmin/static_models/adapter.rb', line 14

def self.column_names(model)
  []
end

.handles?(model) ⇒ Boolean

True if this adapter manages the given model class.

Returns:

  • (Boolean)


9
10
11
# File 'lib/madmin/static_models/adapter.rb', line 9

def self.handles?(model)
  false
end

.modelsObject

All model classes managed by this adapter that are currently loaded. Used by the install generator to create resources.



20
21
22
# File 'lib/madmin/static_models/adapter.rb', line 20

def self.models
  []
end