bootscaf 0.1.18 → 0.1.19

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
  SHA1:
3
- metadata.gz: 129faf95168b2857433903fc6f792bee2f4398b5
4
- data.tar.gz: dc173adebccf566e31d376c7929ae8c4da943080
3
+ metadata.gz: 0cfdb5b1d321befac162780438c1c5514a5a2f75
4
+ data.tar.gz: 23dc6f8d5d3b95ad550452aa14949c5aef5f273f
5
5
  SHA512:
6
- metadata.gz: 3e2faf625116dcfd4d2470871803098ad0a0e8fca4d6422ba8019ed0276478531a785253c61cc49a396f57b2de0f63f8678c0eab5407dfaae63b7314dfaf5f8d
7
- data.tar.gz: 7cd0dd8ea4b34570d5ba6dde771f7f04f395339bfbf8d57b0d7efddfefd359935d57b9dfb3ec31f1ffef0e80e1612887ef2a639a8669237411acfb3b4128dbe3
6
+ metadata.gz: ce3657f36807c3222a748196788d1ab5ee59472a2b3c138d12d8f7464b68cd3538c7e801856d6a9c283d7fe4f3bf9f450c5aaaad9c5981fd1ea7350816ea92a2
7
+ data.tar.gz: e33889e572649d1dc77340b5ebab0506c386aae580329ff2050167bfafbbe802cbe58fe26f5b99ac12eac5de5c8ea6f49ff7e034ee909b3d59c3726bbedbe8e6
data/lib/bootscaf/cli.rb CHANGED
@@ -32,8 +32,10 @@ module Bootscaf
32
32
  print "Running on #{modelname} scaffolds with nesting path `#{singularized_ancestors.join(' > ')}`.\n"
33
33
 
34
34
  print "Updating app/controllers/#{modelname}_controller.rb.\n"
35
- singularized_ancestors.each_with_index do |sa, idx|
35
+ singularized_ancestors.reverse.each do |sa|
36
36
  print `sed #{icmd} -e 's/Controller < ApplicationController/Controller < ApplicationController\\\nbefore_action :set_#{sa}/' app/controllers/#{modelname}_controller.rb`
37
+ end
38
+ singularized_ancestors.each_with_index do |sa, idx|
37
39
  if idx == 0
38
40
  print `sed #{icmd} -e 's/private/private\\\n\\\ndef set_#{sa}\\\n@#{sa} = #{sa.capitalize}.find_by_id(params[:#{sa}_id])\\\nraise ActiveRecord::RecordNotFound unless @#{sa}\\\nend\\\n/' app/controllers/#{modelname}_controller.rb`
39
41
  else
@@ -1,3 +1,3 @@
1
1
  module Bootscaf
2
- VERSION = "0.1.18"
2
+ VERSION = "0.1.19"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootscaf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.18
4
+ version: 0.1.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Moore