Sha256: 70ce41f8ac2b74e95a25f8fef6a50ca1e21159c0fe3030a92ea76af7e6de7528

Contents?: true

Size: 556 Bytes

Versions: 3

Compression:

Stored size: 556 Bytes

Contents

module Effective
  module Resources
    module Model
      attr_accessor :model  # As defined by effective_resource do block in a model file

      def _initialize_model(&block)
        @model = ModelReader.new(&block)

        # If effective_developer is in live mode, this will cause it to refresh the class
        ActiveSupport.run_load_hooks(:effective_resource, klass)
      end

      def model
        @model || (klass.effective_resource.model if klass.respond_to?(:effective_resource) && klass.effective_resource)
      end

    end
  end
end




Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
effective_resources-1.0.0 app/models/effective/resources/model.rb
effective_resources-0.10.1 app/models/effective/resources/model.rb
effective_resources-0.10.0 app/models/effective/resources/model.rb