Sha256: 7bffdc5cac109d61588566e6d3d54c492175a56fc4fa03941da2fd89948c3ad7

Contents?: true

Size: 432 Bytes

Versions: 4

Compression:

Stored size: 432 Bytes

Contents

module PgHero
  module HomeHelper
    def pghero_pretty_ident(table, schema: nil)
      ident = table
      if schema && schema != "public"
        ident = "#{schema}.#{table}"
      end
      if ident =~ /\A[a-z0-9_]+\z/
        ident
      else
        @database.quote_ident(ident)
      end
    end

    def pghero_js_var(name, value)
      "var #{name} = #{json_escape(value.to_json(root: false))};".html_safe
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
pghero-2.4.1 app/helpers/pg_hero/home_helper.rb
pghero-2.4.0 app/helpers/pg_hero/home_helper.rb
pghero-2.3.0 app/helpers/pg_hero/home_helper.rb
pghero-2.2.1 app/helpers/pg_hero/home_helper.rb