app/controllers/decidim/debates/admin/debates_controller.rb in decidim-debates-0.10.1 vs app/controllers/decidim/debates/admin/debates_controller.rb in decidim-debates-0.11.0.pre1
- old
+ new
@@ -10,11 +10,11 @@
def new
@form = form(Decidim::Debates::Admin::DebateForm).instance
end
def create
- @form = form(Decidim::Debates::Admin::DebateForm).from_params(params, current_feature: current_feature)
+ @form = form(Decidim::Debates::Admin::DebateForm).from_params(params, current_component: current_component)
CreateDebate.call(@form) do
on(:ok) do
flash[:notice] = I18n.t("debates.create.success", scope: "decidim.debates.admin")
redirect_to debates_path
@@ -32,11 +32,11 @@
@form = form(DebateForm).from_model(debate)
end
def update
authorize! :edit, debate
- @form = form(DebateForm).from_params(params, current_feature: current_feature)
+ @form = form(DebateForm).from_params(params, current_component: current_component)
UpdateDebate.call(@form, debate) do
on(:ok) do
flash[:notice] = I18n.t("debates.update.success", scope: "decidim.debates.admin")
redirect_to debates_path
@@ -59,10 +59,10 @@
end
private
def debates
- @debates ||= Debate.where(feature: current_feature)
+ @debates ||= Debate.where(component: current_component)
end
def debate
@debate ||= debates.find(params[:id])
end