Skip to content

Instantly share code, notes, and snippets.

@flash-gordon
Created September 7, 2016 13:12
Show Gist options
  • Save flash-gordon/901b94a9af623952f1babca50d7b8cd9 to your computer and use it in GitHub Desktop.
Save flash-gordon/901b94a9af623952f1babca50d7b8cd9 to your computer and use it in GitHub Desktop.
custom inferrer
require 'rom/sql/types/pg'
module ROM
module SQL
class Schema
class PGInferrer < Inferrer
# define all pg specific logic here
end
end
end
end
require 'rom/sql/schema/pg_inferrer'
class Users < ROM::Relation[:sql]
schema_inferrer ROM::SQL::Schema::PGInferrer
schema(infer: true)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment