Sha256: e07398eae4132b8d354900a479f26eef96819f476f02756bfeadb1bccca24d33
Contents?: true
Size: 369 Bytes
Versions: 4
Compression:
Stored size: 369 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
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
uploadbox-0.0.7 | app/models/image.rb |
uploadbox-0.0.6 | app/models/image.rb |
uploadbox-0.0.5 | app/models/image.rb |
uploadbox-0.0.4 | app/models/image.rb |