Sha256: f944d7745cfb9222df2287151ebb81ee6d286ef12ab5d6b1f0f5794df0cffaeb

Contents?: true

Size: 771 Bytes

Versions: 8

Compression:

Stored size: 771 Bytes

Contents

require "golden_fleece/model/context"
require "golden_fleece/model/export"
require "golden_fleece/model/normalization"
require "golden_fleece/model/active_model/normalization"
require "golden_fleece/model/active_model/validation"

module GoldenFleece
  module Model
    def self.included(base)
      # Include ORM-specific modules depending on what ORM we're using
      orm = if defined? ::ActiveModel
        "ActiveModel"
      end
      orm_module = "GoldenFleece::Model::#{orm}".constantize

      base.class_eval do
        include GoldenFleece::Model::Context
        include GoldenFleece::Model::Export
        include GoldenFleece::Model::Normalization
        include orm_module::Normalization
        include orm_module::Validation
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
golden_fleece-1.0.1 lib/golden_fleece/model.rb
golden_fleece-1.0.0 lib/golden_fleece/model.rb
golden_fleece-0.1.5 lib/golden_fleece/model.rb
golden_fleece-0.1.4 lib/golden_fleece/model.rb
golden_fleece-0.1.3 lib/golden_fleece/model.rb
golden_fleece-0.1.2 lib/golden_fleece/model.rb
golden_fleece-0.1.1 lib/golden_fleece/model.rb
golden_fleece-0.1.0 lib/golden_fleece/model.rb