lib/torque/postgresql/adapter/database_statements.rb in torque-postgresql-2.1.1 vs lib/torque/postgresql/adapter/database_statements.rb in torque-postgresql-2.1.2
- old
+ new
@@ -121,11 +121,11 @@
GROUP BY child.relname, pg_inherits.inhrelid
ORDER BY pg_inherits.inhrelid
SQL
tables.map do |(table, refs)|
- [table, Coder.decode(refs)]
+ [table, PG::TextDecoder::Array.new.decode(refs)]
end.to_h
end
# Get the list of columns, and their definition, but only from the
# actual table, does not include columns that comes from inherited table
@@ -143,23 +143,9 @@
AND a.attnum > 0
AND a.attisdropped IS FALSE
#{local_condition}
ORDER BY a.attnum
SQL
- end
-
- # Extracts the value from a PostgreSQL column default definition.
- def extract_value_from_default(default)
- case default
- # Array elements
- when /\AARRAY\[(.*)\]\z/
- # TODO: Improve this since it's not the most safe approach
- eval(default.gsub(/ARRAY|::\w+(\[\])?/, ''))
- else
- super
- end
- rescue SyntaxError
- # If somethin goes wrong with the eval, just return nil
end
end
end
end