Sha256: 75f77fe3452b58f493be7723a71bbb1dedf7b653cf54f5ab110c37f88222ad00

Contents?: true

Size: 412 Bytes

Versions: 2

Compression:

Stored size: 412 Bytes

Contents

module ActiverecordToPoro
  module MetadataEnabled
    def _metadata
      @_metadata ||= Metadata.new
    end


    def _set_metadata_from_ar=(ar_object)
      _metadata.initialize_from_ar(ar_object)
    end

  end

  module MetadataToAr
    def _set_metadata_to_ar=(metadata)
      metadata.each_pair do |attr, value|
        self.send("#{attr}=", value)
        @new_record = false
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
activerecord_to_poro-0.0.2 lib/activerecord_to_poro/metadata_enabled.rb
activerecord_to_poro-0.0.1 lib/activerecord_to_poro/metadata_enabled.rb