method
inspect
rails latest stable - Class:
ActiveRecord::Base
Method deprecated or moved
This method is deprecated or moved on the latest stable version. The last existing version (v3.2.13) is shown here.
inspect()public
Returns a string like ‘Post(id:integer, title:string, body:text)’
# 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 Related methods
- Instance methods
- <=>
- ==
- connection
- dup
- encode_with
- eql?
- freeze
- frozen?
- hash
- init_with
- initialize_dup
- inspect
- readonly!
- readonly?
- to_yaml
- yaml_initialize
- Class methods
- ===
- arel_engine
- arel_table
- clear_active_connections!
- configurations
- connected?
- connection
- connection_config
- connection_handler
- connection_id
- connection_id=
- connection_pool
- default_timezone
- establish_connection
- generated_feature_methods
- inherited
- initialize_generated_modules
- inspect
- logger
- mysql2_connection
- mysql_connection
- new
- postgresql_connection
- remove_connection
- retrieve_connection
- schema_format
- sqlite3_connection
- timestamped_migrations
- Private methods
-
relation -
to_ary