aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb')
-rw-r--r--railties/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb5
1 files changed, 5 insertions, 0 deletions
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 e2e8b18eab..662b5e206e 100644
--- a/railties/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb
+++ b/railties/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb
@@ -54,6 +54,11 @@ module TestUnit # :nodoc:
end
end.sort.to_h
end
+
+ def boolean?(name)
+ attribute = attributes.find { |attribute| attribute.name == name }
+ attribute&.type == :boolean
+ end
end
end
end