Sha256: db1155fd4022c971efae6b9da0c141c248cce28a19fecf4bff1659a06c75c9e1

Contents?: true

Size: 265 Bytes

Versions: 18

Compression:

Stored size: 265 Bytes

Contents

class ImageField
  include Mongoid::Fields::Serializable

  def deserialize(object)
    Image.find(object).file
  end

  def serialize(object)
    if object.class == BSON::ObjectId
      return object
    else
      return BSON::ObjectId(object)
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
classiccms-0.5.6 lib/classiccms/custom.rb
classiccms-0.5.5 lib/classiccms/custom.rb
classiccms-0.5.2 lib/classiccms/custom.rb
classiccms-0.5.1 lib/classiccms/custom.rb
classiccms-0.5.0 lib/classiccms/custom.rb
classiccms-0.4.2 lib/classiccms/custom.rb
classiccms-0.4.1 lib/classiccms/custom.rb
classiccms-0.4.0 lib/classiccms/custom.rb
classiccms-0.3.9 lib/classiccms/custom.rb
classiccms-0.3.8 lib/classiccms/custom.rb
classiccms-0.3.7 lib/classiccms/custom.rb
classiccms-0.3.6 lib/classiccms/custom.rb
classiccms-0.3.5 lib/classiccms/custom.rb
classiccms-0.3.4 lib/classiccms/custom.rb
classiccms-0.3.3 lib/classiccms/custom.rb
classiccms-0.3.2 lib/classiccms/custom.rb
classiccms-0.3.1 lib/classiccms/custom.rb
classiccms-0.3.0 lib/classiccms/custom.rb