Sha256: 103e02818e1d2a1c03178dddf9d50e6ae763cc6020223a1b5a92eab5245e145c

Contents?: true

Size: 549 Bytes

Versions: 1

Compression:

Stored size: 549 Bytes

Contents

module Hatio
  module PluggableSpot
    # Pluggable Spot for Domain Model
    DOMAIN_MODEL_PLUGGABLES = []
    AFTER_PLUGIN_LOAD = []
    
    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
    
    def self.add_domain_pluggable(&block)
      if block_given?
        DOMAIN_MODEL_PLUGGABLES << block
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hatio-core-0.0.6 lib/hatio-core/pluggable/pluggable_spot.rb