method

attributes_hash

Importance_0
Ruby on Rails latest stable (v7.1.3.2) - 0 notes - Class: TestUnit::Generators::ScaffoldGenerator
attributes_hash() private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File railties/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb, line 45
        def attributes_hash
          return {} if attributes_names.empty?

          attributes_names.filter_map do |name|
            if %(password password_confirmation).include?(name) && attributes.any?(&:password_digest?)
              ["#{name}", '"secret"']
            elsif !virtual?(name)
              ["#{name}", "@#{singular_table_name}.#{name}"]
            end
          end.sort.to_h
        end
Register or log in to add new notes.