Sha256: 27b249a6bf355096dfea36ce771f4c9d119f9397e93a01fbd4a3a1d4f782965f
Contents?: true
Size: 619 Bytes
Versions: 40
Compression:
Stored size: 619 Bytes
Contents
module CouchPotato module Attachments def self.included(base) #:nodoc: base.class_eval do attr_writer :_attachments def _attachments @_attachments ||= {} end base.extend ClassMethods end end def to_hash if _attachments && _attachments.any? 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
40 entries across 40 versions & 2 rubygems