Created
September 7, 2016 13:12
-
-
Save flash-gordon/901b94a9af623952f1babca50d7b8cd9 to your computer and use it in GitHub Desktop.
custom inferrer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rom/sql/types/pg' | |
module ROM | |
module SQL | |
class Schema | |
class PGInferrer < Inferrer | |
# define all pg specific logic here | |
end | |
end | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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