method
attributes_hash
v5.2.3 -
Show latest stable
- Class:
TestUnit::Generators::ScaffoldGenerator
attributes_hash()private
No documentation available.
# File railties/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb, line 46
def attributes_hash
return {} if attributes_names.empty?
attributes_names.map do |name|
if %(password password_confirmation).include?(name) && attributes.any?(&:password_digest?)
["#{name}", "'secret'"]
else
["#{name}", "@#{singular_table_name}.#{name}"]
end
end.sort.to_h
end