collavre_plan 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/controllers/collavre_plan/plans_controller.rb +4 -16
- data/lib/collavre_plan/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4aaffa06c4ef2ea1ba5bf37257c1f33d82040780a7c0c044dac5bfb0c9257f2b
|
|
4
|
+
data.tar.gz: 64f03918d432b2b9b3a77d96ce91326a5ce0d9624882570721b43f9b7e691acc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 051dfa35dd899eb136365728e9dfc6befb56993b0b3c3f2d774d0bb49196261a4886dde315f688dd08763dc52721946b6f013b623caf07b517daa60ea11a5eee
|
|
7
|
+
data.tar.gz: dcb2c2f8bcaa205c0972d6c7cd596b508559fe0c19492f5a78a1ba5665cfe760fc15dccee8a5f3a8a3e0d2188e049c6ffdb650b529fa9e0a3fe89e94a8c9b776
|
|
@@ -58,8 +58,8 @@ module CollavrePlan
|
|
|
58
58
|
end
|
|
59
59
|
|
|
60
60
|
def destroy
|
|
61
|
-
@plan = Collavre::Plan.
|
|
62
|
-
|
|
61
|
+
@plan = Collavre::Plan.find_by(id: params[:id])
|
|
62
|
+
raise ActiveRecord::RecordNotFound unless @plan && plan_editable_by_current_user?
|
|
63
63
|
|
|
64
64
|
@plan.destroy
|
|
65
65
|
respond_to do |format|
|
|
@@ -72,8 +72,8 @@ module CollavrePlan
|
|
|
72
72
|
end
|
|
73
73
|
|
|
74
74
|
def update
|
|
75
|
-
@plan = Collavre::Plan.
|
|
76
|
-
|
|
75
|
+
@plan = Collavre::Plan.find_by(id: params[:id])
|
|
76
|
+
raise ActiveRecord::RecordNotFound unless @plan && plan_editable_by_current_user?
|
|
77
77
|
|
|
78
78
|
if @plan.update(plan_update_params)
|
|
79
79
|
respond_to do |format|
|
|
@@ -119,18 +119,6 @@ module CollavrePlan
|
|
|
119
119
|
tagged_creative.has_permission?(Current.user, :write)
|
|
120
120
|
end
|
|
121
121
|
|
|
122
|
-
def render_forbidden
|
|
123
|
-
respond_to do |format|
|
|
124
|
-
format.html do
|
|
125
|
-
redirect_back fallback_location: main_app.root_path,
|
|
126
|
-
alert: t("collavre.plans.update_forbidden", default: "You do not have permission to update this plan.")
|
|
127
|
-
end
|
|
128
|
-
format.json do
|
|
129
|
-
render json: { error: "forbidden" }, status: :forbidden
|
|
130
|
-
end
|
|
131
|
-
end
|
|
132
|
-
end
|
|
133
|
-
|
|
134
122
|
def plan_json(plan, creative_id: nil)
|
|
135
123
|
{
|
|
136
124
|
id: plan.id,
|