Sha256: 7f919a54186ed2c07c85e9be7896960a36140e2cbac2e9b7340d24a4184f7d3b

Contents?: true

Size: 544 Bytes

Versions: 6

Compression:

Stored size: 544 Bytes

Contents

# This object just holds an asset file
# There is a single `global` ck asset in which we use for the ckeditor uploads form

module Effective
  class CkAsset < ActiveRecord::Base
    self.table_name = EffectiveRegions.ck_assets_table_name.to_s

    # Only the global one
    has_many_attached :files

    # The instance ones will have just one file
    has_one_attached :file

    effective_resource do
      global :boolean
    end

    def self.global
      CkAsset.where(global: true).first || CkAsset.create!(global: true)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
effective_regions-1.11.0 app/models/effective/ck_asset.rb
effective_regions-1.10.3 app/models/effective/ck_asset.rb
effective_regions-1.10.2 app/models/effective/ck_asset.rb
effective_regions-1.10.1 app/models/effective/ck_asset.rb
effective_regions-1.10.0 app/models/effective/ck_asset.rb
effective_regions-1.9.0 app/models/effective/ck_asset.rb