提交 d587cf37 编写于 作者: E Emilio Tagua

Removed old commented code

上级 3e4452c7
......@@ -840,27 +840,6 @@ def destroy(id)
# # Update all books that match our conditions, but limit it to 5 ordered by date
# Book.update_all "author = 'David'", "title LIKE '%Rails%'", :order => 'created_at', :limit => 5
def update_all(updates, conditions = nil, options = {})
# sql = "UPDATE #{quoted_table_name} SET #{sanitize_sql_for_assignment(updates)} "
# scope = scope(:find)
# select_sql = ""
# add_conditions!(select_sql, conditions, scope)
# if options.has_key?(:limit) || (scope && scope[:limit])
# # Only take order from scope if limit is also provided by scope, this
# # is useful for updating a has_many association with a limit.
# add_order!(select_sql, options[:order], scope)
# add_limit!(select_sql, options, scope)
# sql.concat(connection.limited_update_conditions(select_sql, quoted_table_name, connection.quote_column_name(primary_key)))
# else
# add_order!(select_sql, options[:order], nil)
# sql.concat(select_sql)
# end
# p sql
# connection.update(sql, "#{name} Update")
scope = scope(:find)
arel = arel_table
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册