提交 5f608fc7 编写于 作者: A Aaron Patterson

removing space errors

上级 c801f233
......@@ -182,7 +182,7 @@ def count(column_name = nil, options = {})
unless options.blank?
raise ArgumentError, "If finder_sql/counter_sql is used then options cannot be passed"
end
@reflection.klass.count_by_sql(custom_counter_sql)
else
......@@ -435,10 +435,10 @@ def custom_counter_sql
# replace the SELECT clause with COUNT(*), preserving any hints within /* ... */
counter_sql = @reflection.options[:finder_sql].sub(/SELECT\b(\/\*.*?\*\/ )?(.*)\bFROM\b/im) { "SELECT #{$1}COUNT(*) FROM" }
end
interpolate_sql(counter_sql)
end
def custom_finder_sql
interpolate_sql(@reflection.options[:finder_sql])
end
......
......@@ -211,12 +211,12 @@ def construct_scope
:create => construct_create_scope
}
end
# Implemented by subclasses
def construct_find_scope
raise NotImplementedError
end
# Implemented by (some) subclasses
def construct_create_scope
{}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册