lib/kasket/select_manager_mixin.rb in kasket-4.4.3 vs lib/kasket/select_manager_mixin.rb in kasket-4.4.4
- old
+ new
@@ -1,5 +1,6 @@
+# frozen_string_literal: true
module Kasket
module SelectManagerMixin
def to_kasket_query(klass, binds = [])
begin
query = Kasket::Visitor.new(klass, binds).accept(ast)
@@ -15,10 +16,10 @@
if query[:limit]
return nil if query[:limit] > 1
# return nil if !query[:index].include?(:id)
end
- if query[:index].size > 1 && query[:attributes].any? { |attribute, value| value.is_a?(Array) }
+ if query[:index].size > 1 && query[:attributes].any? { |_attribute, value| value.is_a?(Array) }
return nil
end
query[:key] = klass.kasket_key_for(query[:attributes])
query[:key] << '/first' if query[:limit] == 1 && !query[:index].include?(:id)