From 243b8480e502b65daa99a8984e5c60b4d311ea58 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Sat, 8 Sep 2018 23:53:03 -0500 Subject: [PATCH] fix collaboration attribute distribution --- app/views/content/_form.html.erb | 2 +- app/views/content/form/_panel.html.erb | 2 +- app/views/content/form/_text_input.html.erb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/content/_form.html.erb b/app/views/content/_form.html.erb index 2c75275c1..9ecdc95be 100644 --- a/app/views/content/_form.html.erb +++ b/app/views/content/_form.html.erb @@ -2,7 +2,7 @@ <%= render 'content/form/errors', content: content %> <%# Content panels %> - <% content.class.attribute_categories(current_user).each do |category| %> + <% content.class.attribute_categories(@content.persisted? ? @content.user : current_user).each do |category| %> <%= render 'content/form/panel', category: category, f: f, content: content %> <% end %> diff --git a/app/views/content/form/_panel.html.erb b/app/views/content/form/_panel.html.erb index b83dd76e3..0f3ee4c97 100644 --- a/app/views/content/form/_panel.html.erb +++ b/app/views/content/form/_panel.html.erb @@ -77,7 +77,7 @@ <% if content.respond_to?(field.name.to_sym) %> <% value = content.send(field.name.to_sym) %> <% else %> - <% value = Attribute.where(user: current_user, entity: content) %> + <% value = Attribute.where(user: @content.user, entity: content) %> <% end %> <% if field.field_type == 'link' %> diff --git a/app/views/content/form/_text_input.html.erb b/app/views/content/form/_text_input.html.erb index a15cb98d6..92ca930e3 100644 --- a/app/views/content/form/_text_input.html.erb +++ b/app/views/content/form/_text_input.html.erb @@ -6,7 +6,7 @@ if f.object.respond_to?(field.name.to_sym) value = f.object.send(field.name.to_sym) else - value = Attribute.where(user: current_user, attribute_field: field, entity: f.object).first + value = Attribute.where(user: @content.user, attribute_field: field, entity: f.object).first end %>