mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
ce7bbc3685
Similar to the work done in #38636, instead of using case statements we can make these classes respond to `fetch_attribute`. New classes can implement `fetch_attribute` instead of adding to the case statement, it's more object oriented, and nicer looking. Co-authored-by: Aaron Patterson <aaron.patterson@gmail.com>
19 lines
370 B
Ruby
19 lines
370 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Arel # :nodoc: all
|
|
module Nodes
|
|
class SqlLiteral < String
|
|
include Arel::Expressions
|
|
include Arel::Predications
|
|
include Arel::AliasPredication
|
|
include Arel::OrderPredications
|
|
|
|
def encode_with(coder)
|
|
coder.scalar = self.to_s
|
|
end
|
|
|
|
def fetch_attribute
|
|
end
|
|
end
|
|
end
|
|
end
|