foldscaf 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md ADDED
@@ -0,0 +1,6 @@
1
+ ## v0.0.3
2
+ * agregado index y unique a slug en migrations
3
+ * eliminado helper
4
+ * model solo muestra private si es necesario
5
+ * model, controller tiene menos espacios en blanco
6
+ * agregado style="text-align:right" al <td> para alinear botones a la derecha
@@ -41,7 +41,6 @@ class FoldGenerator < Rails::Generators::Base
41
41
  template 'model.erb' , "app/models/#{@singular}.rb"
42
42
  template 'migration.erb' , "db/migrate/#{fecha}_create_#{@plural}.rb"
43
43
  template 'controller.erb', "app/controllers/admin/#{@plural}_controller.rb"
44
- template 'helper.erb', "app/helpers/#{@plural}_helper.rb"
45
44
 
46
45
  %w[_form _mini_form edit index new].each do |action|
47
46
  template "views/#{action}.erb", "app/views/admin/#{@plural}/#{action}.html.erb"
@@ -42,11 +42,9 @@ class Admin::<%= @classes %>Controller < Admin::AdminController
42
42
  def mensaje
43
43
  flash.now.notice = t("notice.#{action_name}")
44
44
  end
45
-
46
45
  <%- if @con_orden -%>
47
46
  def sort_coleccion
48
47
  <%= @class %>.all
49
48
  end
50
49
  <%- end -%>
51
-
52
- end
50
+ end
@@ -15,5 +15,8 @@ class Create<%= @classes %> < ActiveRecord::Migration
15
15
 
16
16
  t.timestamps
17
17
  end
18
+ <%- if @con_slug -%>
19
+ add_index :<%= @plural %>, :slug, :unique => true
20
+ <%- end -%>
18
21
  end
19
- end
22
+ end
@@ -4,11 +4,10 @@ class <%= @class %> < ActiveRecord::Base
4
4
  extend FriendlyId
5
5
  friendly_id :<%= @identificador %>, use: :slugged
6
6
  <%- end -%>
7
-
8
7
  <%- atributos_con_referencia.each do |a| -%>
9
8
  belongs_to :<%= a.nombre %>
10
9
  <%- end -%>
11
-
10
+
12
11
  default_scope where(:es_activo => true)<%= ".order('#{@plural}.orden')" if @con_orden %>
13
12
 
14
13
  def eliminar!
@@ -16,11 +15,10 @@ class <%= @class %> < ActiveRecord::Base
16
15
  end
17
16
 
18
17
  alias_attribute :to_s, :<%= @identificador %>
19
-
20
- private
21
18
  <%- if @con_orden -%>
19
+ private
22
20
  def set_orden
23
21
  self.orden = self.id
24
22
  end
25
23
  <%- end -%>
26
- end
24
+ end
@@ -1,7 +1,7 @@
1
1
  <%%- clase ||= 'elemento' -%>
2
2
  <%%= content_tag :tr, :class => clase, :id => "elementos_#{<%= @singular %>.id}" do %>
3
3
  <td><%%= <%= @singular %>.<%= @identificador %> %></td>
4
- <td>
4
+ <td style="text-align:right">
5
5
  <%= "<%= content_tag :i, '',:class => 'handle icon-move', :title => 'Mantenga click y arrastre para reordenar' %\>" if @con_orden %>
6
6
  <%%= link_to 'Editar' , <%= @edit_path %>(<%= @singular %>), :class => 'btn btn-mini' if can? :editar, <%= @singular %> %>
7
7
  <%%= link_to "Eliminar", <%= @singular_path %>(<%= @singular %>), :method => :delete, :confirm => t("confirmacion"), :remote => true, :class => 'btn btn-mini btn-danger' %>
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Foldscaf
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foldscaf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-09 00:00:00.000000000 Z
12
+ date: 2012-03-10 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Generadores adaptados a las necesidades de Xaver
15
15
  email:
@@ -19,6 +19,7 @@ extensions: []
19
19
  extra_rdoc_files: []
20
20
  files:
21
21
  - .gitignore
22
+ - CHANGELOG.md
22
23
  - Gemfile
23
24
  - README.md
24
25
  - Rakefile
@@ -29,7 +30,6 @@ files:
29
30
  - lib/generators/fold/fold_generator.rb
30
31
  - lib/generators/fold/templates/cargar.erb
31
32
  - lib/generators/fold/templates/controller.erb
32
- - lib/generators/fold/templates/helper.erb
33
33
  - lib/generators/fold/templates/migration.erb
34
34
  - lib/generators/fold/templates/model.erb
35
35
  - lib/generators/fold/templates/views/_form.erb
@@ -1,3 +0,0 @@
1
- module <%= @classes %>Helper
2
- # Your code goes here
3
- end