Fixed that Active Record would call SHOW FIELDS twice (or more) for the same...

Fixed that Active Record would call SHOW FIELDS twice (or more) for the same model when the cached results were available #1947 [sd@notso.net]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2153 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 bf92aacf
*SVN*
* Added use_silence parameter to ActiveRecord::Base.benchmark that can be passed false to include all logging statements during the benchmark block
* Fixed that Active Record would call SHOW FIELDS twice (or more) for the same model when the cached results were available #1947 [sd@notso.net]
* Added log_level and use_silence parameter to ActiveRecord::Base.benchmark. The first controls at what level the benchmark statement will be logged (now as debug, instead of info) and the second that can be passed false to include all logging statements during the benchmark block/
* Make sure the schema_info table is created before querying the current version #1903
......
......@@ -1389,7 +1389,7 @@ def interpolate_sql(sql, record = nil)
# that a new instance, or one populated from a passed-in Hash, still has all the attributes
# that instances loaded from the database would.
def attributes_from_column_definition
connection.columns(self.class.table_name, "#{self.class.name} Columns").inject({}) do |attributes, column|
self.class.columns.inject({}) do |attributes, column|
attributes[column.name] = column.default unless column.name == self.class.primary_key
attributes
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册