Sha256: 6ccec6540ae15d1f1d7e2989f219a831485806b79ebce1bed663c4c74dcd00e7
Contents?: true
Size: 589 Bytes
Versions: 6
Compression:
Stored size: 589 Bytes
Contents
module CouchPotato module Attachments def self.included(base) base.class_eval do attr_writer :_attachments def _attachments @_attachments ||= {} end base.extend ClassMethods end end def to_hash if _attachments super.merge('_attachments' => _attachments) else super end end module ClassMethods def json_create(json) instance = super instance._attachments = json['_attachments'] if json instance end end end end
Version data entries
6 entries across 6 versions & 1 rubygems