Sha256: 69d387b47d6f06c751d1594d1839be75785fa258d5bbb082aee1a59558bbc2c1

Contents?: true

Size: 737 Bytes

Versions: 5

Compression:

Stored size: 737 Bytes

Contents

module Qor
  module Layout
    class Asset < ::ActiveRecord::Base
      self.table_name = 'qor_layout_assets'
      has_drafts(:shadow_id => false) if respond_to?(:has_drafts)

      paperclip_config = Qor::Layout.paperclip_config || {
        :image_path => ":rails_root/public/system/qor_layout_assets/:id/:style.:extension",
        :image_url => "/system/qor_layout_assets/:id/:style.:extension",
      }

      has_attached_file :data, {:path => paperclip_config[:image_path], :url => paperclip_config[:image_url]}.merge(paperclip_config)

      def method_missing(method_sym, *args, &block)
        if data.respond_to?(method_sym)
          return data.send(method_sym, *args)
        end
        super
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
qor_layout-0.0.5 app/models/qor/layout/asset.rb
qor_layout-0.0.4 app/models/qor/layout/asset.rb
qor_layout-0.0.3 app/models/qor/layout/asset.rb
qor_layout-0.0.2 app/models/qor/layout/asset.rb
qor_layout-0.0.1 app/models/qor/layout/asset.rb