class method
self.inspect
Ruby on Rails 3.2.22.5
Since v2.2.3 Last seen in v3.2.22.5Signature
self.inspect()
Returns a string like ‘Post(id:integer, title:string, body:text)’
Source
# File activerecord/lib/active_record/base.rb, line 418
def inspect
if self == Base
super
elsif abstract_class?
"#{super}(abstract)"
elsif table_exists?
attr_list = columns.map { |c| "#{c.name}: #{c.type}" } * ', '
"#{super}(#{attr_list})"
else
"#{super}(Table doesn't exist)"
end
end
Defined in activerecord/lib/active_record/base.rb line 418
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Base