typus 0.9.29 → 0.9.30

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. data/README.rdoc +4 -54
  2. data/VERSION +1 -1
  3. data/app/controllers/admin/master_controller.rb +36 -18
  4. data/app/helpers/admin/form_helper.rb +40 -7
  5. data/app/helpers/admin/table_helper.rb +6 -17
  6. data/app/views/admin/resources/show.html.erb +1 -2
  7. data/app/views/admin/templates/_file.html.erb +2 -40
  8. data/app/views/layouts/admin.html.erb +3 -0
  9. data/config/locales/de.yml +0 -1
  10. data/config/locales/es.yml +0 -1
  11. data/config/locales/fr.yml +0 -1
  12. data/config/locales/language.yml.template +0 -1
  13. data/config/locales/pt-BR.yml +0 -1
  14. data/config/locales/ru.yml +0 -1
  15. data/generators/typus/templates/public/stylesheets/admin/screen.css +1 -1
  16. data/generators/typus/typus_generator.rb +1 -1
  17. data/lib/typus/preview.rb +66 -2
  18. data/tasks/typus_tasks.rake +0 -2
  19. data/test/config/working/application.yml +9 -3
  20. data/test/config/working/application_roles.yml +3 -1
  21. data/test/fixtures/app/views/admin/{comments → posts}/_edit.html.erb +0 -0
  22. data/test/fixtures/app/views/admin/{comments → posts}/_index.html.erb +0 -0
  23. data/test/fixtures/app/views/admin/{comments → posts}/_new.html.erb +0 -0
  24. data/test/fixtures/app/views/admin/{comments → posts}/_show.html.erb +0 -0
  25. data/test/fixtures/app/views/admin/{comments → posts}/_sidebar.html.erb +0 -0
  26. data/test/functional/admin/{assets_controller_test.rb → master_controller_assets_relationships.rb} +23 -13
  27. data/test/functional/admin/master_controller_categories_lists_test.rb +64 -0
  28. data/test/functional/admin/master_controller_posts_before_test.rb +10 -0
  29. data/test/functional/admin/master_controller_posts_crud_test.rb +97 -0
  30. data/test/functional/admin/master_controller_posts_formats_test.rb +59 -0
  31. data/test/functional/admin/master_controller_posts_permissions_test.rb +127 -0
  32. data/test/functional/admin/master_controller_posts_relationships_test.rb +86 -0
  33. data/test/functional/admin/master_controller_posts_roles.rb +50 -0
  34. data/test/functional/admin/master_controller_posts_toggle_test.rb +35 -0
  35. data/test/functional/admin/master_controller_posts_views_test.rb +209 -0
  36. data/test/functional/admin/{status_controller_test.rb → master_controller_tableless_resource_test.rb} +5 -11
  37. data/test/functional/admin/{typus_users_controller_test.rb → master_controller_typus_users_test.rb} +10 -37
  38. data/test/functional/typus_controller_test.rb +154 -136
  39. data/test/helpers/admin/form_helper_test.rb +49 -27
  40. data/test/helpers/admin/sidebar_helper_test.rb +4 -7
  41. data/test/lib/active_record_test.rb +8 -8
  42. data/test/lib/typus_test.rb +1 -1
  43. data/test/models.rb +8 -1
  44. data/test/schema.rb +6 -0
  45. data/test/unit/typus_user_roles_test.rb +4 -4
  46. data/typus.gemspec +31 -21
  47. metadata +31 -21
  48. data/test/functional/admin/categories_controller_test.rb +0 -105
  49. data/test/functional/admin/comments_controller_test.rb +0 -121
  50. data/test/functional/admin/master_controller_test.rb +0 -51
  51. data/test/functional/admin/posts_controller_test.rb +0 -300
data/README.rdoc CHANGED
@@ -75,62 +75,12 @@ mailing list.
75
75
  Tell everybody about *Typus*, tell your friends and colleagues about
76
76
  *Typus* and blog about *Typus*.
77
77
 
78
- == Fancybox for assets
78
+ == Using Typus as a Gem?
79
79
 
80
- You can preview assets using Fancybox[http://fancybox.net/example].
80
+ If you are using *Typus* as a gem add the following line at the end of the
81
+ <tt>Rakefile</tt> on the root of your Rails application.
81
82
 
82
- # db/migrate/create_photos.rb
83
-
84
- class CreatePhotos < ActiveRecord::Migration
85
-
86
- def self.up
87
- create_table :photos do |t|
88
- t.string :asset_file_name
89
- t.string :asset_content_type
90
- t.integer :asset_file_size
91
- t.datetime :asset_updated_at
92
- end
93
- end
94
-
95
- def self.down
96
- drop_table :photos
97
- end
98
-
99
- end
100
-
101
- # app/models/photo.rb
102
-
103
- ##
104
- # Styles are predefined but you can use your own by defining them
105
- # on `config/initializers/typus.rb`.
106
- #
107
- # Typus::Configuration.options[:file_preview] = :my_preview
108
- # Typus::Configuration.options[:file_thumbnail] = :my_thumbnail
109
- ##
110
- class Photo < ActiveRecord::Base
111
- has_attached_file :asset, :styles => { :typus_preview => "692x461", :typus_thumbnail => "100x100" }
112
- end
113
-
114
- # app/views/admin/photos/_index.html.erb
115
-
116
- <%- content_for :stylesheets do -%>
117
- <%= stylesheet_link_tag 'admin/jquery.fancybox', :media => 'screen' %>
118
- <%- end -%>
119
-
120
- <%- content_for :javascripts do -%>
121
-
122
- <%= javascript_include_tag 'admin/jquery-1.3.2.min' %>
123
- <%= javascript_include_tag 'admin/jquery.fancybox-1.2.1.min' %>
124
-
125
- <script type="text/javascript" charset="utf-8">
126
- $(document).ready(function() {
127
- <%- @items.each do |item| -%>
128
- $("#<%= item.to_dom %>").fancybox();
129
- <%- end -%>
130
- });
131
- </script>
132
-
133
- <%- end -%>
83
+ Dir["#{RAILS_ROOT}/vendor/gems/*/**/tasks/**/*.rake"].sort.each { |ext| load ext }
134
84
 
135
85
  == Contributors
136
86
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.9.29
1
+ 0.9.30
@@ -109,17 +109,37 @@ class Admin::MasterController < ApplicationController
109
109
  end
110
110
 
111
111
  def edit
112
+
112
113
  item_params = params.dup
113
114
  %w( action controller model model_id back_to id resource resource_id page ).each { |p| item_params.delete(p) }
115
+
114
116
  # We assign the params passed trough the url
115
117
  @item.attributes = item_params
118
+
119
+ # If we want to display only user items, we don't want the links previous and
120
+ # next linking to records from other users.
121
+ conditions = if @resource[:class].typus_options_for(:only_user_items)
122
+ { Typus.user_fk => @current_user.id }
123
+ end
124
+
125
+ item_params.merge!(conditions || {})
116
126
  @previous, @next = @item.previous_and_next(item_params)
127
+
117
128
  select_template :edit
129
+
118
130
  end
119
131
 
120
132
  def show
121
133
 
122
- @previous, @next = @item.previous_and_next
134
+ check_ownership_of_item and return if @resource[:class].typus_options_for(:only_user_items)
135
+
136
+ # If we want to display only user items, we don't want the links previous and
137
+ # next linking to records from other users.
138
+ conditions = if @resource[:class].typus_options_for(:only_user_items)
139
+ { Typus.user_fk => @current_user.id }
140
+ end
141
+
142
+ @previous, @next = @item.previous_and_next(conditions || {})
123
143
 
124
144
  respond_to do |format|
125
145
  format.html { select_template :show }
@@ -193,7 +213,7 @@ class Admin::MasterController < ApplicationController
193
213
 
194
214
  ##
195
215
  # Relate a model object to another, this action is used only by the
196
- # has_and_belongs_to_many relationships.
216
+ # has_and_belongs_to_many and has_many relationships.
197
217
  #
198
218
  def relate
199
219
 
@@ -206,35 +226,33 @@ class Admin::MasterController < ApplicationController
206
226
  :model_a => resource_class.typus_human_name,
207
227
  :model_b => @resource[:class].typus_human_name)
208
228
 
209
- redirect_to :action => @resource[:class].typus_options_for(:default_action_on_item),
210
- :id => @item.id,
211
- :anchor => resource_tableized
229
+ redirect_to :back
212
230
 
213
231
  end
214
232
 
215
233
  ##
216
- # Remove relationship between models.
234
+ # Remove relationship between models, this action never removes items!
217
235
  #
218
236
  def unrelate
219
237
 
220
238
  resource_class = params[:resource].classify.constantize
221
239
  resource = resource_class.find(params[:resource_id])
222
240
 
223
- case params[:association]
224
- when 'has_and_belongs_to_many'
225
- @item.send(resource_class.table_name).delete(resource)
226
- message = "{{model_a}} unrelated from {{model_b}}."
227
- when 'has_many', 'has_one'
228
- resource.destroy
229
- message = "{{model_a}} removed from {{model_b}}."
241
+ if @resource[:class].
242
+ reflect_on_association(resource_class.table_name.singularize.to_sym).
243
+ try(:macro) == :has_one
244
+ attribute = resource_class.table_name.singularize
245
+ @item.update_attribute attribute, nil
246
+ else
247
+ attribute = resource_class.table_name
248
+ @item.send(attribute).delete(resource)
230
249
  end
231
250
 
232
- flash[:success] = _(message, :model_a => resource_class.typus_human_name, :model_b => @resource[:class].typus_human_name)
251
+ flash[:success] = _("{{model_a}} unrelated from {{model_b}}.",
252
+ :model_a => resource_class.typus_human_name,
253
+ :model_b => @resource[:class].typus_human_name)
233
254
 
234
- redirect_to :controller => @resource[:self],
235
- :action => @resource[:class].typus_options_for(:default_action_on_item),
236
- :id => @item.id,
237
- :anchor => resource_class.table_name
255
+ redirect_to :back
238
256
 
239
257
  end
240
258
 
@@ -115,15 +115,41 @@ module Admin::FormHelper
115
115
  :resource_id => @item.id,
116
116
  foreign_key => @item.id }
117
117
 
118
+ condition = if @resource[:class].typus_user_id? && !@current_user.is_root?
119
+ @item.owned_by?(@current_user)
120
+ else
121
+ true
122
+ end
123
+
124
+ if condition
125
+ add_new = <<-HTML
126
+ <small>#{link_to _("Add new"), link_options if @current_user.can_perform?(model_to_relate, 'create')}</small>
127
+ HTML
128
+ end
129
+
118
130
  html << <<-HTML
119
131
  <a name="#{field}"></a>
120
- <div class="box_relationships">
132
+ <div class="box_relationships" id="#{model_to_relate_as_resource}">
121
133
  <h2>
122
134
  #{link_to model_to_relate.typus_human_name.pluralize, { :controller => "admin/#{model_to_relate_as_resource}", foreign_key => @item.id }, :title => _("{{model}} filtered by {{filtered_by}}", :model => model_to_relate.typus_human_name.pluralize, :filtered_by => @item.typus_name)}
123
- <small>#{link_to _("Add new"), link_options if @current_user.can_perform?(model_to_relate, 'create')}</small>
135
+ #{add_new}
124
136
  </h2>
125
137
  HTML
126
138
 
139
+ ##
140
+ # It's a has_many relationship, so items that are already assigned to another
141
+ # entry are assigned to that entry.
142
+ #
143
+ items_to_relate = model_to_relate.find(:all, :conditions => ["#{foreign_key} is ?", nil])
144
+ if condition && !items_to_relate.empty?
145
+ html << <<-HTML
146
+ #{form_tag :action => 'relate', :id => @item.id}
147
+ #{hidden_field :related, :model, :value => model_to_relate}
148
+ <p>#{select :related, :id, items_to_relate.collect { |f| [f.typus_name, f.id] }.sort_by { |e| e.first } } &nbsp; #{submit_tag _("Add"), :class => 'button'}</p>
149
+ </form>
150
+ HTML
151
+ end
152
+
127
153
  conditions = if model_to_relate.typus_options_for(:only_user_items) && !@current_user.is_root?
128
154
  { Typus.user_fk => @current_user }
129
155
  end
@@ -168,9 +194,13 @@ module Admin::FormHelper
168
194
  reflection = @resource[:class].reflect_on_association(field.to_sym)
169
195
  association = reflection.macro
170
196
 
171
- condition = !(@resource[:class].typus_user_id? && @current_user.id == @item.send(Typus.user_fk))
197
+ condition = if @resource[:class].typus_user_id? && !@current_user.is_root?
198
+ @item.owned_by?(@current_user)
199
+ else
200
+ true
201
+ end
172
202
 
173
- unless condition
203
+ if condition
174
204
  add_new = <<-HTML
175
205
  <small>#{link_to _("Add new"), :controller => field, :action => 'new', :back_to => @back_to, :resource => @resource[:self], :resource_id => @item.id if @current_user.can_perform?(model_to_relate, 'create')}</small>
176
206
  HTML
@@ -178,21 +208,24 @@ module Admin::FormHelper
178
208
 
179
209
  html << <<-HTML
180
210
  <a name="#{field}"></a>
181
- <div class="box_relationships">
211
+ <div class="box_relationships" id="#{model_to_relate_as_resource}">
182
212
  <h2>
183
213
  #{link_to model_to_relate.typus_human_name.pluralize, :controller => "admin/#{model_to_relate_as_resource}"}
184
214
  #{add_new}
185
215
  </h2>
186
216
  HTML
217
+
187
218
  items_to_relate = (model_to_relate.find(:all) - @item.send(field))
188
- unless condition || items_to_relate.empty?
219
+
220
+ if condition && !items_to_relate.empty?
189
221
  html << <<-HTML
190
222
  #{form_tag :action => 'relate', :id => @item.id}
191
223
  #{hidden_field :related, :model, :value => model_to_relate}
192
- <p>#{ select :related, :id, items_to_relate.collect { |f| [f.typus_name, f.id] }.sort_by { |e| e.first } } &nbsp; #{submit_tag _("Add"), :class => 'button'}</p>
224
+ <p>#{select :related, :id, items_to_relate.collect { |f| [f.typus_name, f.id] }.sort_by { |e| e.first } } &nbsp; #{submit_tag _("Add"), :class => 'button'}</p>
193
225
  </form>
194
226
  HTML
195
227
  end
228
+
196
229
  items = @resource[:class].find(params[:id]).send(field)
197
230
  unless items.empty?
198
231
  html << build_list(model_to_relate,
@@ -35,7 +35,7 @@ module Admin::TableHelper
35
35
 
36
36
  action = if model.typus_user_id? && !@current_user.is_root?
37
37
  # If there's a typus_user_id column on the table and logged user is not root ...
38
- item.owned_by?(@current_user) ? 'edit' : 'show'
38
+ item.owned_by?(@current_user) ? item.class.typus_options_for(:default_action_on_item) : 'show'
39
39
  elsif !@current_user.can_perform?(model, 'edit')
40
40
  'show'
41
41
  else
@@ -71,7 +71,7 @@ module Admin::TableHelper
71
71
  :method => :delete if condition
72
72
  when 'edit'
73
73
  # If we are editing content, we can relate and unrelate always!
74
- perform = link_to unrelate, { :action => 'unrelate', :id => params[:id], :association => association, :resource => model, :resource_id => item.id },
74
+ perform = link_to unrelate, { :action => 'unrelate', :id => params[:id], :resource => model, :resource_id => item.id },
75
75
  :title => _("Unrelate"),
76
76
  :confirm => _("Unrelate {{unrelate_model}} from {{unrelate_model_from}}?",
77
77
  :unrelate_model => model.typus_human_name,
@@ -84,7 +84,7 @@ module Admin::TableHelper
84
84
  condition = if @resource[:class].typus_user_id? && !@current_user.is_root?
85
85
  @item.owned_by?(@current_user)
86
86
  end
87
- perform = link_to unrelate, { :action => 'unrelate', :id => params[:id], :association => association, :resource => model, :resource_id => item.id },
87
+ perform = link_to unrelate, { :action => 'unrelate', :id => params[:id], :resource => model, :resource_id => item.id },
88
88
  :title => _("Unrelate"),
89
89
  :confirm => _("Unrelate {{unrelate_model}} from {{unrelate_model_from}}?",
90
90
  :unrelate_model => model.typus_human_name,
@@ -167,20 +167,9 @@ module Admin::TableHelper
167
167
  end
168
168
 
169
169
  def typus_table_file_field(attribute, item, link_options = {})
170
-
171
- attachment = attribute.split('_file_name').first
172
- file_preview = Typus::Configuration.options[:file_preview]
173
-
174
- if item.send(attachment).styles.member?(file_preview) && item.send("#{attachment}_content_type") =~ /^image\/.+/
175
- <<-HTML
176
- <td><a id="#{item.to_dom}" href="#{item.send(attachment).url(file_preview)}" title="#{item.typus_name}">#{item.send(attribute)}</a></td>
177
- HTML
178
- else
179
- <<-HTML
180
- <td>#{link_to item.send(attribute), item.send(attachment).url}</td>
181
- HTML
182
- end
183
-
170
+ <<-HTML
171
+ <td>#{item.typus_preview_on_table(attribute)}</td>
172
+ HTML
184
173
  end
185
174
 
186
175
  def typus_table_tree_field(attribute, item)
@@ -21,8 +21,7 @@
21
21
  when :belongs_to
22
22
  raw_data.typus_name
23
23
  when :file
24
- attachment = field.first.split('_file_name').first
25
- @item.typus_preview(attachment)
24
+ @item.typus_preview(field.first)
26
25
  when :text
27
26
  defined?(RDiscount) ? markdown(raw_data) : raw_data
28
27
  else
@@ -1,44 +1,6 @@
1
- <%- content_for :stylesheets do -%>
2
- <%= stylesheet_link_tag 'admin/jquery.fancybox', :media => 'screen' %>
3
- <%- end -%>
4
-
5
- <%- content_for :javascripts do -%>
6
-
7
- <%= javascript_include_tag 'admin/jquery-1.3.2.min' %>
8
- <%= javascript_include_tag 'admin/jquery.fancybox-1.2.1.min' %>
9
-
10
- <script type="text/javascript" charset="utf-8">
11
- $(document).ready(function() {
12
- $("#<%= @item.to_dom %>").fancybox();
13
- });
14
- </script>
15
-
16
- <%- end -%>
17
-
18
- <%
19
-
20
- attachment = attribute.split('_file_name').first
21
- file_preview = Typus::Configuration.options[:file_preview]
22
- file_thumbnail = Typus::Configuration.options[:file_thumbnail]
23
-
24
- unless @item.send(attribute).blank?
25
- item = @item.send(attachment)
26
- preview = if @item.send("#{attachment}_content_type") =~ /^image\/.+/ && item.styles.member?(file_thumbnail)
27
- <<-HTML
28
- <a id="#{@item.to_dom}" href="#{@item.send(attachment).url(file_preview)}" title="#{@item.typus_name}">
29
- #{image_tag item.url(file_thumbnail)}
30
- </a>
31
- HTML
32
- else
33
- <<-HTML
34
- #{link_to @item.send(attribute), item.url}
35
- HTML
36
- end
37
- end
38
-
39
- %>
1
+ <% attachment = attribute.split('_file_name').first %>
40
2
 
41
3
  <li><label for="item_<%= attribute %>"><%= _(attachment.humanize) %></label>
42
4
  <%= file_field :item, attachment, :disabled => attribute_disabled?(attribute) %>
43
- <%= preview %>
5
+ <%= @item.typus_preview(attribute) unless @item.send(attribute).blank? %>
44
6
  </li>
@@ -11,9 +11,12 @@
11
11
 
12
12
  <%= stylesheet_link_tag 'admin/reset', :media => 'screen' %>
13
13
  <%= stylesheet_link_tag 'admin/screen', :media => 'screen' %>
14
+ <%= stylesheet_link_tag 'admin/jquery.fancybox', :media => 'screen' %>
14
15
  <%= yield :stylesheets -%>
15
16
 
16
17
  <%= javascript_include_tag 'admin/application' %>
18
+ <%= javascript_include_tag 'admin/jquery-1.3.2.min' %>
19
+ <%= javascript_include_tag 'admin/jquery.fancybox-1.2.1.min' %>
17
20
  <%= include_tiny_mce_if_needed if defined?(TinyMCE) -%>
18
21
  <%= yield :javascripts -%>
19
22
 
@@ -55,7 +55,6 @@ de:
55
55
  "{{model_a}} related to {{model_b}}": "{{model_a}} ist verkn&uuml;pft mit {{model_b}}"
56
56
  "{{model_a}} successfully assigned to {{model_b}}": "{{model_a}} erfolgreich an {{model_b}} zugewiesen"
57
57
  "{{model_a}} unrelated from {{model_b}}": "{{model_a}} unverbunden mit {{model_b}}"
58
- "{{model_a}} removed from {{model_b}}": "{{model_a}} erfolgreich von {{model_b}}entfernt"
59
58
  "Your new password is {{password}}": "Ihr neues Passwort ist {{password}}"
60
59
  "Add entry": "Eintrag erstellen"
61
60
  "Go to": "Gehe zu"
@@ -55,7 +55,6 @@ es:
55
55
  "{{model_a}} related to {{model_b}}": "{{model_a}} relacionado con {{model_b}}."
56
56
  "{{model_a}} successfully assigned to {{model_b}}": "{{model_a}} asignado satisfactoriamente a {{model_b}}."
57
57
  "{{model_a}} unrelated from {{model_b}}": "{{model_a}} no esta relacionado con {{model_b}}."
58
- "{{model_a}} removed from {{model_b}}": "{{model_a}} borrado de {{model_b}}."
59
58
  "Your new password is {{password}}": "Tu nueva contraseña es {{password}}."
60
59
  "Add entry": "Añadir entrada"
61
60
  "Go to": "Ir a"
@@ -55,7 +55,6 @@ fr:
55
55
  "{{model_a}} related to {{model_b}}": "{{model_a}} associé à {{model_b}}."
56
56
  "{{model_a}} successfully assigned to {{model_b}}": "{{model_a}} associé à {{model_b}}."
57
57
  "{{model_a}} unrelated from {{model_b}}": "{{model_a}} dissocié de {{model_b}}."
58
- "{{model_a}} removed from {{model_b}}": "{{model_a}} retiré de {{model_b}}."
59
58
  "Your new password is {{password}}": "Votre nouveau mot-de-passe est {{password}}."
60
59
  "Add entry": "Ajouter une entrée"
61
60
  "Go to": "Aller"
@@ -98,6 +98,5 @@
98
98
  "{{model}} successfully updated":
99
99
  "{{model}} {{attribute}} changed":
100
100
  "{{model_a}} related to {{model_b}}":
101
- "{{model_a}} removed from {{model_b}}":
102
101
  "{{model_a}} successfully assigned to {{model_b}}":
103
102
  "{{model_a}} unrelated from {{model_b}}":
@@ -54,7 +54,6 @@ pt-BR:
54
54
  "{{model_a}} related to {{model_b}}": "{{model_a}} relacionado com {{model_b}}."
55
55
  "{{model_a}} successfully assigned to {{model_b}}": "{{model_a}} atribuído com sucesso a {{model_b}}."
56
56
  "{{model_a}} unrelated from {{model_b}}": "{{model_a}} não está relacionado com {{model_b}}."
57
- "{{model_a}} removed from {{model_b}}": "{{model_a}} removido de {{model_b}}."
58
57
  "Your new password is {{password}}": "Sua nova senha é {{password}}."
59
58
  "Add entry": "Adicionar entrada"
60
59
  "Go to": "Ir a"
@@ -55,7 +55,6 @@ ru:
55
55
  "{{model_a}} related to {{model_b}}": "{{model_a}} присоединен с {{model_b}}."
56
56
  "{{model_a}} successfully assigned to {{model_b}}": "{{model_a}} добавлен к {{model_b}}."
57
57
  "{{model_a}} unrelated from {{model_b}}": "{{model_a}} отсоединен от {{model_b}}."
58
- "{{model_a}} removed from {{model_b}}": "{{model_a}} удален из {{model_b}}."
59
58
  "Your new password is {{password}}": "Ваш новый пароль: {{password}}."
60
59
  "Add entry": "Добавить запись"
61
60
  "Go to": "Перейти к"
@@ -68,7 +68,7 @@ a.on { color: #333; font-weight: bold; text-decoration: underline; }
68
68
 
69
69
  /* @group Content */
70
70
 
71
- #content { float: left; padding: 1.5em 0; width: 700px; }
71
+ #content { float: left; padding: 1.5em 0; width: 700px; overflow-x: auto; }
72
72
 
73
73
  #content h2 { font-size: 1.5em; font-weight: bold; margin: 0 0 0.5em 0; }
74
74
  #content h2 a { font-weight: bold; }
@@ -46,7 +46,7 @@ class TypusGenerator < Rails::Generator::Base
46
46
  model_columns = model.columns - reject_columns
47
47
 
48
48
  # Don't show `text` fields and timestamps in lists.
49
- list = model_columns.reject { |c| c.sql_type == 'text' || %w( created_at updated_at ).include?(c.name) }.map(&:name)
49
+ list = model_columns.reject { |c| c.sql_type == 'text' || %w( id created_at updated_at ).include?(c.name) }.map(&:name)
50
50
  # Don't show timestamps in forms.
51
51
  form = model_columns.reject { |c| %w( id created_at updated_at ).include?(c.name) }.map(&:name)
52
52
  # Show all model columns in the show action.