From 3d8fcdd3bf21482e3e297a78bfdf3d02ec71eda4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Thu, 6 Dec 2012 18:00:41 -0200 Subject: Put the reference and belongs_to attributes in the scaffold tests. --- .../rails/generators/test_unit/scaffold/scaffold_generator.rb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'railties/lib/rails/generators') diff --git a/railties/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb b/railties/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb index 3b4fec2e83..8939813304 100644 --- a/railties/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb +++ b/railties/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb @@ -18,17 +18,14 @@ module TestUnit # :nodoc: private def attributes_hash - return if accessible_attributes.empty? + return if attributes.empty? - accessible_attributes.map do |a| + attributes.map do |a| name = a.name + name = "#{name}_id" if a.reference? "#{name}: @#{singular_table_name}.#{name}" end.sort.join(', ') end - - def accessible_attributes - attributes.reject(&:reference?) - end end end end -- cgit v1.2.3