1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/lib/arel/nodes/sql_literal.rb
eileencodes ce7bbc3685
Refactor fetch_attribute
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>
2020-03-13 13:38:32 -04:00

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