And even more generic
This commit is contained in:
@@ -179,8 +179,8 @@ module Dunlop::SourceFileModel
|
||||
|
||||
# braindump towards state => processed support for source-files
|
||||
def latest_processed
|
||||
if base_class == self
|
||||
join_select = processed.select('MAX(id) AS max_id').group(:sti_type)
|
||||
if base_class == self # return a scope having only the latest processed source-files
|
||||
join_select = processed.select('MAX(id) AS max_id').group(inheritance_column)
|
||||
#join_select = processed.selecting{ id.maximum.as('max_id')}.group(:sti_type)
|
||||
joins("INNER JOIN (#{join_select.to_sql}) tmp ON id = tmp.max_id")
|
||||
else # return the latest process of the specific source-file class
|
||||
|
||||
Reference in New Issue
Block a user