starter_generators 0.9.2 → 0.9.3

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: 79b95f7fa81b5cd6c11b52a75224aebec7a3b003
4
- data.tar.gz: e40d10a8e215e21374011b2eab4ad306e8fa973b
3
+ metadata.gz: 1f5e5f55ceda5478d60e1958b0f0abf9ca791a6d
4
+ data.tar.gz: 7f0ad610bdec9c1a3d7922a3af49241f7de1b24d
5
5
  SHA512:
6
- metadata.gz: 64c01b661b420d8b72e4b15f6174103e328719fe46d2d57a6a1dd8bd929d999410f3a1e0cbe80d64282f8523031a4987e23985e5cbd22a0cc9aaa44c7a0cbb7c
7
- data.tar.gz: 56328b9783d733b664807bbe5d6e4d50e1a1f9ac5a4d0d7eed85edd03c390fee11186301c7fa173467eda3a3ddcaa98f5a02b02a59bbe26709b18c2bd8ceed1a
6
+ metadata.gz: c3b42871fb34530a335d17b8021978e7b0d3f4276dcd96f871b6728dbabe8cf278d5eaecac0b5333b54dfd0bd308e71f72aadc32d8093987329a926036f8238c
7
+ data.tar.gz: 11709f417840c5c212d0d2d50fc43485e0fb79eb80b1a6c665d73a307e415b5792e0c19b4e8cbb27a1c1bbc589818010bc9ab81897f2edf6e568419a1a8a4e28
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## Version 0.9.3 (Oct 30, 2013)
2
+ * Change find_by_id to find_by(:id => params[:id])
3
+ * Change named routes to use old-style hash syntax
4
+
1
5
  ## Version 0.9.2 (Oct 22, 2013)
2
6
  * Added skip_controller and skip_model options (default: false)
3
7
 
@@ -84,15 +84,15 @@ module Starter
84
84
  def golden_7_named
85
85
  ["# Routes for the #{singular_name.capitalize} resource:",
86
86
  " # CREATE",
87
- " get '/#{plural_name}/new', controller: '#{plural_name}', action: 'new', as: 'new_#{singular_name}'",
87
+ " get '/#{plural_name}/new', controller: '#{plural_name}', action: 'new', :as => 'new_#{singular_name}'",
88
88
  " post '/#{plural_name}', controller: '#{plural_name}', action: 'create'",
89
89
  "",
90
90
  " # READ",
91
91
  " get '/#{plural_name}', controller: '#{plural_name}', action: 'index'",
92
- " get '/#{plural_name}/:id', controller: '#{plural_name}', action: 'show', as: '#{singular_name}'",
92
+ " get '/#{plural_name}/:id', controller: '#{plural_name}', action: 'show', :as => '#{singular_name}'",
93
93
  "",
94
94
  " # UPDATE",
95
- " get '/#{plural_name}/:id/edit', controller: '#{plural_name}', action: 'edit', as: 'edit_#{singular_name}'",
95
+ " get '/#{plural_name}/:id/edit', controller: '#{plural_name}', action: 'edit', :as => 'edit_#{singular_name}'",
96
96
  " patch '/#{plural_name}/:id', controller: '#{plural_name}', action: 'update'",
97
97
  "",
98
98
  " # DELETE",
@@ -5,7 +5,7 @@ class <%= plural_name.camelize %>Controller < ApplicationController
5
5
  end
6
6
 
7
7
  def show
8
- @<%= singular_name.underscore %> = <%= class_name %>.find_by_id(params[:id])
8
+ @<%= singular_name.underscore %> = <%= class_name %>.find_by(:id => params[:id])
9
9
  end
10
10
 
11
11
  def new
@@ -33,11 +33,11 @@ class <%= plural_name.camelize %>Controller < ApplicationController
33
33
  end
34
34
 
35
35
  def edit
36
- @<%= singular_name.underscore %> = <%= class_name %>.find_by_id(params[:id])
36
+ @<%= singular_name.underscore %> = <%= class_name %>.find_by(:id => params[:id])
37
37
  end
38
38
 
39
39
  def update
40
- @<%= singular_name.underscore %> = <%= class_name %>.find_by_id(params[:id])
40
+ @<%= singular_name.underscore %> = <%= class_name %>.find_by(:id => params[:id])
41
41
  <% attributes.each do |attribute| -%>
42
42
  @<%= singular_name.underscore %>.<%= attribute.name %> = params[:<%= attribute.name %>]
43
43
  <% end %>
@@ -57,7 +57,7 @@ class <%= plural_name.camelize %>Controller < ApplicationController
57
57
  end
58
58
 
59
59
  def destroy
60
- @<%= singular_name.underscore %> = <%= class_name %>.find_by_id(params[:id])
60
+ @<%= singular_name.underscore %> = <%= class_name %>.find_by(:id => params[:id])
61
61
  @<%= singular_name.underscore %>.destroy
62
62
  <% if named_routes? -%>
63
63
  redirect_to <%= plural_name %>_url
@@ -1,3 +1,3 @@
1
1
  module StarterGenerators
2
- VERSION = "0.9.2"
2
+ VERSION = "0.9.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: starter_generators
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
4
+ version: 0.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Cohen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-23 00:00:00.000000000 Z
11
+ date: 2013-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -105,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
105
105
  version: '0'
106
106
  requirements: []
107
107
  rubyforge_project:
108
- rubygems_version: 2.0.3
108
+ rubygems_version: 2.1.10
109
109
  signing_key:
110
110
  specification_version: 4
111
111
  summary: Helpful enhancements to the Rails environment for beginner-focused classes.