Sha256: cb95286484f7911d99b7c3074c99a0190bdbfc6279670fdccbfe068c3539e59d
Contents?: true
Size: 518 Bytes
Versions: 13
Compression:
Stored size: 518 Bytes
Contents
# encoding: utf-8 module DynamicImage # = DynamicImage Belongs To # module BelongsTo extend ActiveSupport::Concern module ClassMethods def belongs_to_image(name, scope = nil, options = {}) belongs_to(name, scope, options) define_method "#{name}=" do |new_image| if new_image.present? && !new_image.is_a?(DynamicImage::Model) new_image = send("build_#{name}", file: new_image) end super(new_image) end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems