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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f1f4d20acde286797f3e083741480a5c654a0c93f9a674c09cedfc5bc7865f55
4
- data.tar.gz: 81034f4bd8a3e0c6b36bd8d59786fbae8f5f0e141fcf34c29d88fce8feadf199
3
+ metadata.gz: 4aaffa06c4ef2ea1ba5bf37257c1f33d82040780a7c0c044dac5bfb0c9257f2b
4
+ data.tar.gz: 64f03918d432b2b9b3a77d96ce91326a5ce0d9624882570721b43f9b7e691acc
5
5
  SHA512:
6
- metadata.gz: 6a366c4ef91d21b2caba0215f42ac7a1489b9b5ed251039da6baf12858b7f0de7e0cca533a3783d7d21f3839aa642811dc86e62a75522333f882a3bd1d30652f
7
- data.tar.gz: e75dd6df51d244be43629f6ac461493810c71d61e6b4db42d8261d1dd574c71deb1b50b328cfc8ce5015c4ac2a10c0d7e55dde085f880d6a29cfb37e9ab1c9af
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.find(params[:id])
62
- return render_forbidden unless plan_editable_by_current_user?
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.find(params[:id])
76
- return render_forbidden unless plan_editable_by_current_user?
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,
@@ -1,3 +1,3 @@
1
1
  module CollavrePlan
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: collavre_plan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Collavre