mirror of
https://github.com/github/rails.git
synced 2026-02-08 13:15:23 -05:00
Added ActiveRecord::Base.inspect to return a column-view like #<Post id:integer, title:string, body:text> [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6549 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
*SVN*
|
||||
|
||||
* Added ActiveRecord::Base.inspect to return a column-view like #<Post id:integer, title:string, body:text> [DHH]
|
||||
|
||||
* Added yielding of Builder instance for ActiveRecord::Base#to_xml calls [DHH]
|
||||
|
||||
* Small additions and fixes for ActiveRecord documentation. Closes #7342 [jeremymcanally]
|
||||
|
||||
@@ -862,6 +862,11 @@ module ActiveRecord #:nodoc:
|
||||
end
|
||||
end
|
||||
|
||||
# Returns a string looking like: #<Post id:integer, title:string, body:text>
|
||||
def inspect
|
||||
"#<#{name} #{columns.collect { |c| "#{c.name}:#{c.type}" }.join(", ")}>"
|
||||
end
|
||||
|
||||
|
||||
def quote_value(value, column = nil) #:nodoc:
|
||||
connection.quote(value,column)
|
||||
|
||||
Reference in New Issue
Block a user