Module: Hatio::PluggableSpot

Defined in:
lib/hatio-core/pluggable/pluggable_spot.rb

Constant Summary collapse

DOMAIN_MODEL_PLUGGABLES =

Pluggable Spot for Domain Model

[]
AFTER_PLUGIN_LOAD =
[]

Class Method Summary collapse

Class Method Details

.add_domain_pluggable(&block) ⇒ Object



16
17
18
19
20
# File 'lib/hatio-core/pluggable/pluggable_spot.rb', line 16

def self.add_domain_pluggable(&block)
  if block_given?
    DOMAIN_MODEL_PLUGGABLES << block
  end
end

.after_plugin_load(&block) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/hatio-core/pluggable/pluggable_spot.rb', line 7

def self.after_plugin_load(&block)
  if defined? ActiveRecord::Base
    return unless ActiveRecord::Base.connection.table_exists?("schema_migrations") # for settings table...
  end
  if block_given?
    AFTER_PLUGIN_LOAD << block
  end
end