class method self.attribute_names

Ruby on Rails 3.1.12

Since v3.1.12 Last seen in v3.1.12

Signature

self.attribute_names()

Returns an array of column names as strings if it’s not an abstract class and table exists. Otherwise it returns an empty array.

Source
# File activerecord/lib/active_record/base.rb, line 797
      def attribute_names
        @attribute_names ||= if !abstract_class? && table_exists?
            column_names
          else
            []
          end
      end

Defined in activerecord/lib/active_record/base.rb line 797 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveRecord::Base

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close