Sha256: 900258d1dcd45c68671b24e6f6c150646e2e1f22de3c66e587aaf2e1b1d3212c

Contents?: true

Size: 842 Bytes

Versions: 3

Compression:

Stored size: 842 Bytes

Contents

class Comfy::Admin::Blog::Revisions::PostController < Comfy::Admin::Cms::Revisions::BaseController

  def show
    @current_content = @record.fragments.each_with_object({}) do |b, c|
      c[b.identifier] = b.content
    end
    @versioned_content = @record.fragments.each_with_object({}) do |b, c|
      data = @revision.data["fragments_attributes"].detect { |r| r[:identifier] == b.identifier }
      c[b.identifier] = data.try(:[], :content)
    end

    render "comfy/admin/cms/revisions/show"
  end

private

  def load_record
    @record = @site.blog_posts.find(params[:blog_post_id])
  rescue ActiveRecord::RecordNotFound
    flash[:danger] = I18n.t("comfy.admin.cms.revisions.record_not_found")
    redirect_to comfy_admin_blog_posts_path(@site)
  end

  def record_path
    edit_comfy_admin_blog_post_path(@site, @record)
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
comfy_blog-2.0.5 app/controllers/comfy/admin/blog/revisions/post_controller.rb
comfy_blog-2.0.4 app/controllers/comfy/admin/blog/revisions/post_controller.rb
comfy_blog-2.0.3 app/controllers/comfy/admin/blog/revisions/post_controller.rb