Sha256: b149f29944c325de5729754e076de3e90b238deaedf8198a070f9f2a04687953

Contents?: true

Size: 373 Bytes

Versions: 4

Compression:

Stored size: 373 Bytes

Contents

# frozen_string_literal: true

# Returns the PostgreSQL statement to get a JSON object field as text. Note this work for both
# JSON and JSONB type columns. More details:
# https://www.postgresql.org/docs/current/functions-json.html
class JSONKey < Arel::Nodes::InfixOperation
  def initialize(left, right)
    super("->>", left, Arel::Nodes.build_quoted(right))
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
decidim-action_delegator-0.6.0 lib/json_key.rb
decidim-action_delegator-0.5.0 lib/json_key.rb
decidim-action_delegator-0.4.1 lib/json_key.rb
decidim-action_delegator-0.4 lib/json_key.rb