Sha256: a548b71598ba73ce87b54a12b9b4fab0433f53b42b9460c47b5abf1a52a69ba0

Contents?: true

Size: 586 Bytes

Versions: 137

Compression:

Stored size: 586 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 = (model || ModelReader.new)
        @model.read(&block)

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

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

    end
  end
end




Version data entries

137 entries across 137 versions & 1 rubygems

Version Path
effective_resources-1.9.9 app/models/effective/resources/model.rb
effective_resources-1.9.8 app/models/effective/resources/model.rb
effective_resources-1.9.7 app/models/effective/resources/model.rb
effective_resources-1.9.6 app/models/effective/resources/model.rb
effective_resources-1.9.5 app/models/effective/resources/model.rb
effective_resources-1.9.4 app/models/effective/resources/model.rb
effective_resources-1.9.3 app/models/effective/resources/model.rb
effective_resources-1.9.2 app/models/effective/resources/model.rb
effective_resources-1.9.1 app/models/effective/resources/model.rb
effective_resources-1.9.0 app/models/effective/resources/model.rb
effective_resources-1.8.38 app/models/effective/resources/model.rb
effective_resources-1.8.37 app/models/effective/resources/model.rb
effective_resources-1.8.36 app/models/effective/resources/model.rb
effective_resources-1.8.35 app/models/effective/resources/model.rb
effective_resources-1.8.34 app/models/effective/resources/model.rb
effective_resources-1.8.33 app/models/effective/resources/model.rb
effective_resources-1.8.32 app/models/effective/resources/model.rb
effective_resources-1.8.31 app/models/effective/resources/model.rb
effective_resources-1.8.30 app/models/effective/resources/model.rb
effective_resources-1.8.29 app/models/effective/resources/model.rb