Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions lib/arel_extensions/predications.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,26 +75,5 @@ def not_in(*other) # In should handle nil element in the Array
Arel::Nodes::NotIn.new(self, quoted_node(other))
end
end

def convert_to_node(object)
case object
when Arel::Attributes::Attribute, Arel::Nodes::Node, Integer
object
when DateTime
Arel.quoted(object, self)
when Time
Arel.quoted(object.strftime('%H:%M:%S'), self)
when String
Arel.quoted(object)
when Date
Arel.quoted(object.to_s, self)
when NilClass
Arel.sql('NULL')
when ActiveSupport::Duration
object.to_i
else
raise(ArgumentError, "#{object.class} cannot be converted to CONCAT arg")
end
end
end
end