5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-26 12:16:22 +00:00

fix: no usar PostRelation para instanciar un nuevo Post #7537

obligaba a cargar casi todo el sitio en memoria y muchas lecturas de
disco
This commit is contained in:
f 2023-10-06 10:14:13 -03:00
parent 59828b3f6a
commit 1ad4eeccb4
No known key found for this signature in database

View file

@ -54,9 +54,11 @@ class PostsController < ApplicationController
def new def new
authorize Post authorize Post
@post = site.posts(lang: locale).build(layout: params[:layout])
breadcrumb I18n.t('loaf.breadcrumbs.posts.new', layout: @post.layout.humanized_name.downcase), '' layout = site.layouts[params[:layout].to_sym]
@post = Post.build(locale: locale, layout: layout, site: site)
breadcrumb I18n.t('loaf.breadcrumbs.posts.new', layout: layout.humanized_name.downcase), ''
end end
def create def create