├── .github └── workflows │ └── build.yml ├── .gitignore ├── .rspec ├── CHANGELOG.md ├── Gemfile ├── ISSUE_TEMPLATE.md ├── LICENSE.txt ├── README.md ├── Rakefile ├── baby_squeel.gemspec ├── bin ├── console └── setup ├── lib ├── baby_squeel.rb └── baby_squeel │ ├── active_record │ ├── base.rb │ ├── calculations.rb │ ├── query_methods.rb │ ├── version_helper.rb │ └── where_chain.rb │ ├── association.rb │ ├── calculation.rb │ ├── compat.rb │ ├── dsl.rb │ ├── errors.rb │ ├── join.rb │ ├── join_dependency.rb │ ├── nodes.rb │ ├── nodes │ ├── attribute.rb │ ├── binary.rb │ ├── function.rb │ ├── grouping.rb │ ├── node.rb │ └── proxy.rb │ ├── operators.rb │ ├── relation.rb │ ├── resolver.rb │ ├── table.rb │ └── version.rb └── spec ├── baby_squeel ├── __snapshots__ │ └── association_spec.yaml ├── active_record │ └── query_methods │ │ └── injector6_1_spec.rb ├── association_spec.rb ├── calculation_spec.rb ├── compat_spec.rb ├── dsl_spec.rb ├── join_dependency │ └── injector6_0_spec.rb ├── join_spec.rb ├── nodes │ ├── attribute_spec.rb │ ├── binary_spec.rb │ ├── function_spec.rb │ ├── node_spec.rb │ └── proxy_spec.rb ├── operators │ ├── comparison_spec.rb │ ├── equality_spec.rb │ ├── generic_spec.rb │ ├── grouping_spec.rb │ └── matching_spec.rb ├── relation_spec.rb ├── resolver_spec.rb └── table_spec.rb ├── baby_squeel_spec.rb ├── integration ├── __snapshots__ │ ├── grouping_spec.yaml │ ├── joining_spec.yaml │ ├── ordering_spec.yaml │ ├── rails_integration_spec.yaml │ ├── reordering_spec.yaml │ ├── selecting_spec.yaml │ ├── sifting_spec.yaml │ ├── when_having_spec.yaml │ └── where_chain_spec.yaml ├── averaging_spec.rb ├── compat_spec.rb ├── counting_spec.rb ├── grouping_spec.rb ├── joining_spec.rb ├── maximizing_spec.rb ├── minimizing_spec.rb ├── ordering_spec.rb ├── plucking_spec.rb ├── rails_integration_spec.rb ├── reordering_spec.rb ├── selecting_spec.rb ├── sifting_spec.rb ├── summing_spec.rb ├── when_having_spec.rb └── where_chain_spec.rb ├── shared_examples ├── relation.rb └── table.rb ├── spec_helper.rb └── support ├── factories.rb ├── matchers.rb ├── matchers ├── match_formatted.rb ├── match_snapshot.rb ├── snapshot.rb └── sql_formatter.rb ├── models.rb ├── query_tracker.rb └── schema.rb /.github/workflows/build.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/.github/workflows/build.yml -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/.gitignore -------------------------------------------------------------------------------- /.rspec: -------------------------------------------------------------------------------- 1 | --color 2 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/CHANGELOG.md -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/Gemfile -------------------------------------------------------------------------------- /ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/ISSUE_TEMPLATE.md -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/LICENSE.txt -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/README.md -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/Rakefile -------------------------------------------------------------------------------- /baby_squeel.gemspec: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/baby_squeel.gemspec -------------------------------------------------------------------------------- /bin/console: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/bin/console -------------------------------------------------------------------------------- /bin/setup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/bin/setup -------------------------------------------------------------------------------- /lib/baby_squeel.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/lib/baby_squeel.rb -------------------------------------------------------------------------------- /lib/baby_squeel/active_record/base.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/lib/baby_squeel/active_record/base.rb -------------------------------------------------------------------------------- /lib/baby_squeel/active_record/calculations.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/lib/baby_squeel/active_record/calculations.rb -------------------------------------------------------------------------------- /lib/baby_squeel/active_record/query_methods.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/lib/baby_squeel/active_record/query_methods.rb -------------------------------------------------------------------------------- /lib/baby_squeel/active_record/version_helper.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/lib/baby_squeel/active_record/version_helper.rb -------------------------------------------------------------------------------- /lib/baby_squeel/active_record/where_chain.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/lib/baby_squeel/active_record/where_chain.rb -------------------------------------------------------------------------------- /lib/baby_squeel/association.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/lib/baby_squeel/association.rb -------------------------------------------------------------------------------- /lib/baby_squeel/calculation.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/lib/baby_squeel/calculation.rb -------------------------------------------------------------------------------- /lib/baby_squeel/compat.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/lib/baby_squeel/compat.rb -------------------------------------------------------------------------------- /lib/baby_squeel/dsl.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/lib/baby_squeel/dsl.rb -------------------------------------------------------------------------------- /lib/baby_squeel/errors.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/lib/baby_squeel/errors.rb -------------------------------------------------------------------------------- /lib/baby_squeel/join.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/lib/baby_squeel/join.rb -------------------------------------------------------------------------------- /lib/baby_squeel/join_dependency.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/lib/baby_squeel/join_dependency.rb -------------------------------------------------------------------------------- /lib/baby_squeel/nodes.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/lib/baby_squeel/nodes.rb -------------------------------------------------------------------------------- /lib/baby_squeel/nodes/attribute.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/lib/baby_squeel/nodes/attribute.rb -------------------------------------------------------------------------------- /lib/baby_squeel/nodes/binary.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/lib/baby_squeel/nodes/binary.rb -------------------------------------------------------------------------------- /lib/baby_squeel/nodes/function.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/lib/baby_squeel/nodes/function.rb -------------------------------------------------------------------------------- /lib/baby_squeel/nodes/grouping.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/lib/baby_squeel/nodes/grouping.rb -------------------------------------------------------------------------------- /lib/baby_squeel/nodes/node.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/lib/baby_squeel/nodes/node.rb -------------------------------------------------------------------------------- /lib/baby_squeel/nodes/proxy.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/lib/baby_squeel/nodes/proxy.rb -------------------------------------------------------------------------------- /lib/baby_squeel/operators.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/lib/baby_squeel/operators.rb -------------------------------------------------------------------------------- /lib/baby_squeel/relation.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/lib/baby_squeel/relation.rb -------------------------------------------------------------------------------- /lib/baby_squeel/resolver.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/lib/baby_squeel/resolver.rb -------------------------------------------------------------------------------- /lib/baby_squeel/table.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/lib/baby_squeel/table.rb -------------------------------------------------------------------------------- /lib/baby_squeel/version.rb: -------------------------------------------------------------------------------- 1 | module BabySqueel 2 | VERSION = '4.0.0'.freeze 3 | end 4 | -------------------------------------------------------------------------------- /spec/baby_squeel/__snapshots__/association_spec.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/baby_squeel/__snapshots__/association_spec.yaml -------------------------------------------------------------------------------- /spec/baby_squeel/active_record/query_methods/injector6_1_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/baby_squeel/active_record/query_methods/injector6_1_spec.rb -------------------------------------------------------------------------------- /spec/baby_squeel/association_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/baby_squeel/association_spec.rb -------------------------------------------------------------------------------- /spec/baby_squeel/calculation_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/baby_squeel/calculation_spec.rb -------------------------------------------------------------------------------- /spec/baby_squeel/compat_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/baby_squeel/compat_spec.rb -------------------------------------------------------------------------------- /spec/baby_squeel/dsl_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/baby_squeel/dsl_spec.rb -------------------------------------------------------------------------------- /spec/baby_squeel/join_dependency/injector6_0_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/baby_squeel/join_dependency/injector6_0_spec.rb -------------------------------------------------------------------------------- /spec/baby_squeel/join_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/baby_squeel/join_spec.rb -------------------------------------------------------------------------------- /spec/baby_squeel/nodes/attribute_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/baby_squeel/nodes/attribute_spec.rb -------------------------------------------------------------------------------- /spec/baby_squeel/nodes/binary_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/baby_squeel/nodes/binary_spec.rb -------------------------------------------------------------------------------- /spec/baby_squeel/nodes/function_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/baby_squeel/nodes/function_spec.rb -------------------------------------------------------------------------------- /spec/baby_squeel/nodes/node_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/baby_squeel/nodes/node_spec.rb -------------------------------------------------------------------------------- /spec/baby_squeel/nodes/proxy_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/baby_squeel/nodes/proxy_spec.rb -------------------------------------------------------------------------------- /spec/baby_squeel/operators/comparison_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/baby_squeel/operators/comparison_spec.rb -------------------------------------------------------------------------------- /spec/baby_squeel/operators/equality_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/baby_squeel/operators/equality_spec.rb -------------------------------------------------------------------------------- /spec/baby_squeel/operators/generic_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/baby_squeel/operators/generic_spec.rb -------------------------------------------------------------------------------- /spec/baby_squeel/operators/grouping_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/baby_squeel/operators/grouping_spec.rb -------------------------------------------------------------------------------- /spec/baby_squeel/operators/matching_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/baby_squeel/operators/matching_spec.rb -------------------------------------------------------------------------------- /spec/baby_squeel/relation_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/baby_squeel/relation_spec.rb -------------------------------------------------------------------------------- /spec/baby_squeel/resolver_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/baby_squeel/resolver_spec.rb -------------------------------------------------------------------------------- /spec/baby_squeel/table_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/baby_squeel/table_spec.rb -------------------------------------------------------------------------------- /spec/baby_squeel_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/baby_squeel_spec.rb -------------------------------------------------------------------------------- /spec/integration/__snapshots__/grouping_spec.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/integration/__snapshots__/grouping_spec.yaml -------------------------------------------------------------------------------- /spec/integration/__snapshots__/joining_spec.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/integration/__snapshots__/joining_spec.yaml -------------------------------------------------------------------------------- /spec/integration/__snapshots__/ordering_spec.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/integration/__snapshots__/ordering_spec.yaml -------------------------------------------------------------------------------- /spec/integration/__snapshots__/rails_integration_spec.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/integration/__snapshots__/rails_integration_spec.yaml -------------------------------------------------------------------------------- /spec/integration/__snapshots__/reordering_spec.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/integration/__snapshots__/reordering_spec.yaml -------------------------------------------------------------------------------- /spec/integration/__snapshots__/selecting_spec.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/integration/__snapshots__/selecting_spec.yaml -------------------------------------------------------------------------------- /spec/integration/__snapshots__/sifting_spec.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/integration/__snapshots__/sifting_spec.yaml -------------------------------------------------------------------------------- /spec/integration/__snapshots__/when_having_spec.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/integration/__snapshots__/when_having_spec.yaml -------------------------------------------------------------------------------- /spec/integration/__snapshots__/where_chain_spec.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/integration/__snapshots__/where_chain_spec.yaml -------------------------------------------------------------------------------- /spec/integration/averaging_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/integration/averaging_spec.rb -------------------------------------------------------------------------------- /spec/integration/compat_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/integration/compat_spec.rb -------------------------------------------------------------------------------- /spec/integration/counting_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/integration/counting_spec.rb -------------------------------------------------------------------------------- /spec/integration/grouping_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/integration/grouping_spec.rb -------------------------------------------------------------------------------- /spec/integration/joining_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/integration/joining_spec.rb -------------------------------------------------------------------------------- /spec/integration/maximizing_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/integration/maximizing_spec.rb -------------------------------------------------------------------------------- /spec/integration/minimizing_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/integration/minimizing_spec.rb -------------------------------------------------------------------------------- /spec/integration/ordering_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/integration/ordering_spec.rb -------------------------------------------------------------------------------- /spec/integration/plucking_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/integration/plucking_spec.rb -------------------------------------------------------------------------------- /spec/integration/rails_integration_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/integration/rails_integration_spec.rb -------------------------------------------------------------------------------- /spec/integration/reordering_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/integration/reordering_spec.rb -------------------------------------------------------------------------------- /spec/integration/selecting_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/integration/selecting_spec.rb -------------------------------------------------------------------------------- /spec/integration/sifting_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/integration/sifting_spec.rb -------------------------------------------------------------------------------- /spec/integration/summing_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/integration/summing_spec.rb -------------------------------------------------------------------------------- /spec/integration/when_having_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/integration/when_having_spec.rb -------------------------------------------------------------------------------- /spec/integration/where_chain_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/integration/where_chain_spec.rb -------------------------------------------------------------------------------- /spec/shared_examples/relation.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/shared_examples/relation.rb -------------------------------------------------------------------------------- /spec/shared_examples/table.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/shared_examples/table.rb -------------------------------------------------------------------------------- /spec/spec_helper.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/spec_helper.rb -------------------------------------------------------------------------------- /spec/support/factories.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/support/factories.rb -------------------------------------------------------------------------------- /spec/support/matchers.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/support/matchers.rb -------------------------------------------------------------------------------- /spec/support/matchers/match_formatted.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/support/matchers/match_formatted.rb -------------------------------------------------------------------------------- /spec/support/matchers/match_snapshot.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/support/matchers/match_snapshot.rb -------------------------------------------------------------------------------- /spec/support/matchers/snapshot.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/support/matchers/snapshot.rb -------------------------------------------------------------------------------- /spec/support/matchers/sql_formatter.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/support/matchers/sql_formatter.rb -------------------------------------------------------------------------------- /spec/support/models.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/support/models.rb -------------------------------------------------------------------------------- /spec/support/query_tracker.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/support/query_tracker.rb -------------------------------------------------------------------------------- /spec/support/schema.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzane/baby_squeel/HEAD/spec/support/schema.rb --------------------------------------------------------------------------------