Sha256: 4f3bca82f25651e310bb8f7065ed461d6a701733d5ae980dcb6fb183520a30f5
Contents?: true
Size: 373 Bytes
Versions: 24
Compression:
Stored size: 373 Bytes
Contents
class Image < ActiveRecord::Base belongs_to :imageable, polymorphic: true def self.create_upload(attributes) attributes["imageable_type"].constantize # load class upload_class_name = attributes["imageable_type"] + attributes["upload_name"].camelize attributes.delete("upload_name") Uploadbox.const_get(upload_class_name).create!(attributes) end end
Version data entries
24 entries across 24 versions & 1 rubygems