mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
removing space errors
This commit is contained in:
parent
c801f233df
commit
5f608fc7c4
2 changed files with 5 additions and 5 deletions
|
@ -182,7 +182,7 @@ module ActiveRecord
|
|||
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 @@ module ActiveRecord
|
|||
# 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 @@ module ActiveRecord
|
|||
:create => construct_create_scope
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
# Implemented by subclasses
|
||||
def construct_find_scope
|
||||
raise NotImplementedError
|
||||
end
|
||||
|
||||
|
||||
# Implemented by (some) subclasses
|
||||
def construct_create_scope
|
||||
{}
|
||||
|
|
Loading…
Reference in a new issue