Sha256: 9fc92be962f9036f0d7e622674983f6ce7b78087af53287787924143cf752dfa

Contents?: true

Size: 428 Bytes

Versions: 19

Compression:

Stored size: 428 Bytes

Contents

module Pageflow
  class UsedFile < SimpleDelegator
    def initialize(file, usage = nil)
      super(file)
      @usage = usage || file.usages.first
    end

    def configuration
      @usage.configuration
    end

    def update_attributes!(attributes)
      super(attributes.except(:configuration))
      @usage.update_attributes!(attributes.slice(:configuration))
    end

    def usage_id
      @usage.id
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
pageflow-12.6.0 app/models/pageflow/used_file.rb
pageflow-12.5.0 app/models/pageflow/used_file.rb
pageflow-12.4.1 app/models/pageflow/used_file.rb
pageflow-12.4.0 app/models/pageflow/used_file.rb
pageflow-12.3.0 app/models/pageflow/used_file.rb
pageflow-12.2.0 app/models/pageflow/used_file.rb
pageflow-12.1.0 app/models/pageflow/used_file.rb
pageflow-12.0.4 app/models/pageflow/used_file.rb
pageflow-12.0.3 app/models/pageflow/used_file.rb
pageflow-12.0.2 app/models/pageflow/used_file.rb
pageflow-12.0.1 app/models/pageflow/used_file.rb
pageflow-12.0.0 app/models/pageflow/used_file.rb
pageflow-12.0.0.rc7 app/models/pageflow/used_file.rb
pageflow-12.0.0.rc6 app/models/pageflow/used_file.rb
pageflow-12.0.0.rc5 app/models/pageflow/used_file.rb
pageflow-12.0.0.rc4 app/models/pageflow/used_file.rb
pageflow-12.0.0.rc3 app/models/pageflow/used_file.rb
pageflow-12.0.0.rc2 app/models/pageflow/used_file.rb
pageflow-12.0.0.rc1 app/models/pageflow/used_file.rb