Sha256: b72373d0beb786dd6241d9c62c79ecfb9b1519dcb9b19ede78a78a6f6eb8fe4a

Contents?: true

Size: 516 Bytes

Versions: 7

Compression:

Stored size: 516 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Blogs
    module Admin
      # This command is executed when the user changes a Post from the admin
      # panel.
      class UpdatePost < Decidim::Commands::UpdateResource
        fetch_form_attributes :title, :body, :author

        private

        def attributes
          super.merge(published_at: form.published_at).reject do |attribute, value|
            value.blank? && attribute == :published_at
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
decidim-blogs-0.29.2 app/commands/decidim/blogs/admin/update_post.rb
decidim-blogs-0.29.1 app/commands/decidim/blogs/admin/update_post.rb
decidim-blogs-0.29.0 app/commands/decidim/blogs/admin/update_post.rb
decidim-blogs-0.29.0.rc4 app/commands/decidim/blogs/admin/update_post.rb
decidim-blogs-0.29.0.rc3 app/commands/decidim/blogs/admin/update_post.rb
decidim-blogs-0.29.0.rc2 app/commands/decidim/blogs/admin/update_post.rb
decidim-blogs-0.29.0.rc1 app/commands/decidim/blogs/admin/update_post.rb