Sha256: aef63b4d44cbe704172e60642b529633a70b7612a360d4b15438d6298202a240

Contents?: true

Size: 574 Bytes

Versions: 2

Compression:

Stored size: 574 Bytes

Contents

module Locomotive::Wagon

  class PushSiteCommand < PushBaseCommand

    def entities
      [repositories.site.first]
    end

    def decorate(entity)
      IconSiteDecorator.new(entity)
    end

    def persist(decorated_entity)
      _attributes = decorated_entity.to_hash
      if !_attributes.empty? && api_client.current_site.get.attributes[:picture_url].nil?
        api_client.current_site.update(_attributes)
      else
        raise SkipPersistingException.new
      end
    end

    def label_for(decorated_entity)
      decorated_entity.name
    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
locomotivecms_wagon-2.0.0.pre.beta.2 lib/locomotive/wagon/commands/push_sub_commands/push_site_command.rb
locomotivecms_wagon-2.0.0.pre.beta.1 lib/locomotive/wagon/commands/push_sub_commands/push_site_command.rb