dust-generators 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
data/lib/dust/version.rb CHANGED
@@ -2,7 +2,7 @@ class Dust
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- PATCH = 5
5
+ PATCH = 6
6
6
 
7
7
  STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
@@ -1,7 +1,7 @@
1
1
  def create
2
2
  @<%= singular_name %> = <%= class_name %>.new(params[:<%= singular_name %>])
3
3
  if @<%= singular_name %>.save
4
- flash[:notice] = "Successfully created <%= model_name.underscore.humanize.downcase %>."
4
+ flash[:notice] = "Successfully created <%= name.underscore.humanize.downcase %>."
5
5
  redirect_to <%= item_path('url') %>
6
6
  else
7
7
  render :action => 'new'
@@ -1,6 +1,6 @@
1
1
  def destroy
2
2
  @<%= singular_name %> = <%= class_name %>.find(params[:id])
3
3
  @<%= singular_name %>.destroy
4
- flash[:notice] = "Successfully destroyed <%= model_name.underscore.humanize.downcase %>."
4
+ flash[:notice] = "Successfully destroyed <%= name.underscore.humanize.downcase %>."
5
5
  redirect_to <%= items_path('url') %>
6
6
  end
@@ -1,7 +1,7 @@
1
1
  def update
2
2
  @<%= singular_name %> = <%= class_name %>.find(params[:id])
3
3
  if @<%= singular_name %>.update_attributes(params[:<%= singular_name %>])
4
- flash[:notice] = "Successfully updated <%= model_name.underscore.humanize.downcase %>."
4
+ flash[:notice] = "Successfully updated <%= name.underscore.humanize.downcase %>."
5
5
  redirect_to <%= item_path('url') %>
6
6
  else
7
7
  render :action => 'edit'
@@ -1,9 +1,9 @@
1
1
  one:
2
- <%- for attribute in model_attributes -%>
2
+ <%- for attribute in attributes -%>
3
3
  <%= attribute.name %>: <%= attribute.default %>
4
4
  <%- end -%>
5
5
 
6
6
  two:
7
- <%- for attribute in model_attributes -%>
7
+ <%- for attribute in attributes -%>
8
8
  <%= attribute.name %>: <%= attribute.default %>
9
9
  <%- end -%>
@@ -1,7 +1,7 @@
1
1
  class Create<%= plural_class_name %> < ActiveRecord::Migration
2
2
  def self.up
3
3
  create_table :<%= plural_name %> do |t|
4
- <%- for attribute in model_attributes -%>
4
+ <%- for attribute in attributes -%>
5
5
  t.<%= attribute.type %> :<%= attribute.name %>
6
6
  <%- end -%>
7
7
  <%- unless options[:skip_timestamps] -%>
@@ -1,7 +1,7 @@
1
1
  class <%= class_name %> < ActiveRecord::Base
2
- attr_accessible <%= model_attributes.map { |a| ":#{a.name}" }.join(", ") %>
2
+ attr_accessible <%= attributes.map { |a| ":#{a.name}" }.join(", ") %>
3
3
 
4
- <%- first_attribute = model_attributes.first -%>
4
+ <%- first_attribute = attributes.first -%>
5
5
  def self.page(search, page)
6
6
  paginate :per_page => 10, :page => page,
7
7
  :order => 'name',
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dust-generators
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 5
10
- version: 0.1.5
9
+ - 6
10
+ version: 0.1.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - rossnelson