Class: Sequel::Postgres::Dataset
- Inherits:
-
Object
- Object
- Sequel::Postgres::Dataset
- Defined in:
- lib/pg_json/sequel/pg_json.rb
Instance Method Summary collapse
Instance Method Details
#json ⇒ Object
92 93 94 95 96 97 98 99 100 101 |
# File 'lib/pg_json/sequel/pg_json.rb', line 92 def json if f = self.first JSON.parse(f[:to_json]).tap do |h| h.recursively_symbolize_keys! h.json_typify! end else nil end end |
#json_array ⇒ Object
84 85 86 87 88 89 90 91 |
# File 'lib/pg_json/sequel/pg_json.rb', line 84 def json_array self.all.map do |r| JSON.parse(r[:to_json]).tap do |h| h.recursively_symbolize_keys! h.json_typify! end end end |