diff --git a/app/logical/post_sets/base.rb b/app/logical/post_sets/base.rb index f9dc04ff9..1c965be70 100644 --- a/app/logical/post_sets/base.rb +++ b/app/logical/post_sets/base.rb @@ -39,19 +39,5 @@ module PostSets def presenter raise NotImplementedError end - - def arbitrary_sql_order_clause(ids, table_name) - if ids.empty? - return "#{table_name}.id desc" - end - - conditions = [] - - ids.each_with_index do |x, n| - conditions << "when #{x} then #{n}" - end - - "case #{table_name}.id " + conditions.join(" ") + " end" - end end end diff --git a/config/initializers/active_record_extensions.rb b/config/initializers/active_record_extensions.rb index 602ae6b88..360f558b0 100644 --- a/config/initializers/active_record_extensions.rb +++ b/config/initializers/active_record_extensions.rb @@ -33,22 +33,6 @@ module Danbooru connection.__send__(method_name, sanitize_sql_array([sql, *params])) end end - - def arbitrary_sql_order_clause(ids, table_name = nil) - table_name = self.class.table_name if table_name.nil? - - if ids.empty? - return "#{table_name}.id desc" - end - - conditions = [] - - ids.each_with_index do |x, n| - conditions << "when #{x} then #{n}" - end - - "case #{table_name}.id " + conditions.join(" ") + " end" - end end end end