Sha256: 33426ae00ec03204296e625eb4cf2477c7c78a806c08950e2d6a3ebd30a50681

Contents?: true

Size: 386 Bytes

Versions: 13

Compression:

Stored size: 386 Bytes

Contents

class SingleAssetModelForm
  include ActiveModel::Model
  include Tessa::Model

  ATTRIBUTES = %w[
    title
    avatar
  ]

  attr_accessor :single_asset_model
  attr_accessor *ATTRIBUTES

  def self.from_single_asset_model(model, attrs = {})
    new(
      model.attributes
        .slice(*ATTRIBUTES)
        .merge(attrs)
        .merge(single_asset_model: model)
    )
  end

end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
tessa-6.1.3 spec/dummy/app/models/single_asset_model_form.rb
tessa-6.1.2 spec/dummy/app/models/single_asset_model_form.rb
tessa-6.1.1 spec/dummy/app/models/single_asset_model_form.rb
tessa-6.1.0 spec/dummy/app/models/single_asset_model_form.rb
tessa-6.0.3 spec/dummy/app/models/single_asset_model_form.rb
tessa-6.0.2 spec/dummy/app/models/single_asset_model_form.rb
tessa-6.0.1 spec/dummy/app/models/single_asset_model_form.rb
tessa-6.0.0 spec/dummy/app/models/single_asset_model_form.rb
tessa-6.0.0.rc5 spec/dummy/app/models/single_asset_model_form.rb
tessa-6.0.0.rc4 spec/dummy/app/models/single_asset_model_form.rb
tessa-6.0.0.rc3 spec/dummy/app/models/single_asset_model_form.rb
tessa-6.0.0.rc2 spec/dummy/app/models/single_asset_model_form.rb
tessa-6.0.0.rc1 spec/dummy/app/models/single_asset_model_form.rb