active_record-mti 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/.rspec +2 -0
- data/.travis.yml +21 -0
- data/README.md +34 -21
- data/active_record-mti.gemspec +23 -10
- data/lib/active_record/mti.rb +9 -4
- data/lib/active_record/mti/calculations.rb +2 -2
- data/lib/active_record/mti/connection_adapters/postgresql/schema_statements.rb +9 -3
- data/lib/active_record/mti/inheritance.rb +24 -14
- data/lib/active_record/mti/model_schema.rb +24 -0
- data/lib/active_record/mti/query_methods.rb +7 -1
- data/lib/active_record/mti/version.rb +1 -1
- metadata +72 -47
- data/Gemfile.lock +0 -80
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b14d2c9a38a839510f0246918f467e58e592aef4
|
4
|
+
data.tar.gz: bf6e66c09163a3296f93befdbaf1fe7a3b043ad8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7fb70a3c6492b2c70dd4a95198116a9a4dc3eb2e45f66ca5be70b38d5658a38fc39742d820320091b6f3411717ee23a1fca3eb71e362a95cb8dfe7f6803537ee
|
7
|
+
data.tar.gz: e1066d95c0fd0ebdf83fd7d2aded8de84c665829a71929c2e35bdb70b5b9dc7754ee4b11a1f126dac0f30f96a4440ad60fde724f813f624a8c5abc5baf6b22cf
|
data/.gitignore
CHANGED
data/.rspec
ADDED
data/.travis.yml
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
language: ruby
|
2
|
+
sudo: false
|
3
|
+
rvm:
|
4
|
+
- 2.0
|
5
|
+
- 2.1
|
6
|
+
- 2.2
|
7
|
+
- 2.3.1
|
8
|
+
- 2.4.0
|
9
|
+
cache: bundler
|
10
|
+
script:
|
11
|
+
- bundle exec rspec
|
12
|
+
|
13
|
+
after_success:
|
14
|
+
- bundle exec codeclimate-test-reporter
|
15
|
+
|
16
|
+
addons:
|
17
|
+
postgresql: "9.1"
|
18
|
+
|
19
|
+
env:
|
20
|
+
- RSPEC_VERSION="<2.99"
|
21
|
+
- RSPEC_VERSION="~>3.0
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# ActiveRecord::MTI
|
1
|
+
# ActiveRecord::MTI [![Build Status](https://travis-ci.org/TwilightCoders/active_record-mti.svg?branch=master)](https://travis-ci.org/TwilightCoders/active_record-mti) [![Code Climate](https://codeclimate.com/github/TwilightCoders/active_record-mti/badges/gpa.svg)](https://codeclimate.com/github/TwilightCoders/active_record-mti) [![Test Coverage](https://codeclimate.com/github/TwilightCoders/active_record-mti/badges/coverage.svg)](https://codeclimate.com/github/TwilightCoders/active_record-mti/coverage)
|
2
2
|
|
3
3
|
Allows for true native inheritance of tables in PostgreSQL
|
4
4
|
|
@@ -18,6 +18,28 @@ Or install it yourself as:
|
|
18
18
|
|
19
19
|
$ gem install active_record-mti
|
20
20
|
|
21
|
+
### Application Code
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
class Account < ::ActiveRecord::Base
|
25
|
+
uses_mti
|
26
|
+
|
27
|
+
end
|
28
|
+
|
29
|
+
class User < Account
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
class Developer < Account
|
34
|
+
|
35
|
+
end
|
36
|
+
```
|
37
|
+
|
38
|
+
ActiveRecord queries work as usual with the following differences:
|
39
|
+
|
40
|
+
* You need to specify which model represents the base of your multi table inheritance tree. To do so, insert `uses_mti` in the model definition of the base class.
|
41
|
+
* The default query of "*" is changed to include the OID of each row for subclass discrimination. The default select will be `SELECT cast("accounts"."tableoid"::regclass AS text), "accounts".*` (for example)
|
42
|
+
|
21
43
|
### Migrations
|
22
44
|
|
23
45
|
In your migrations define a table to inherit from another table:
|
@@ -25,39 +47,36 @@ In your migrations define a table to inherit from another table:
|
|
25
47
|
```ruby
|
26
48
|
class CreateAccounts < ActiveRecord::Migration
|
27
49
|
def change
|
28
|
-
# Things is the head of or inheritance tree representing all things
|
29
|
-
# both tangible and intangible. Can be considered the vertices in
|
30
|
-
# the graph.
|
31
50
|
create_table :accounts do |t|
|
32
|
-
t.jsonb
|
33
|
-
t.timestamps
|
51
|
+
t.jsonb :settings
|
52
|
+
t.timestamps null: false
|
34
53
|
end
|
35
54
|
|
36
55
|
create_table :users, inherits: :accounts do |t|
|
37
|
-
t.string
|
38
|
-
t.string
|
56
|
+
t.string :firstname
|
57
|
+
t.string :lastname
|
39
58
|
end
|
40
59
|
|
41
60
|
create_table :developers, inherits: :users do |t|
|
42
|
-
t.string
|
43
|
-
t.string
|
61
|
+
t.string :url
|
62
|
+
t.string :api_key
|
44
63
|
end
|
45
64
|
end
|
46
65
|
end
|
47
66
|
|
48
67
|
```
|
49
68
|
|
50
|
-
### Schema
|
69
|
+
### Schema
|
51
70
|
|
52
|
-
A schema will be created that reflects the inheritance chain so that rake:db:schema:load will work
|
71
|
+
A schema will be created that reflects the inheritance chain so that `rake:db:schema:load` will work
|
53
72
|
|
54
73
|
```ruby
|
55
|
-
|
74
|
+
ActiveRecord::Schema.define(version: 20160910024954) do
|
56
75
|
|
57
76
|
create_table "accounts", force: :cascade do |t|
|
58
77
|
t.jsonb "settings"
|
59
|
-
t.datetime "created_at"
|
60
|
-
t.datetime "updated_at"
|
78
|
+
t.datetime "created_at", null: false
|
79
|
+
t.datetime "updated_at", null: false
|
61
80
|
end
|
62
81
|
|
63
82
|
create_table "users", inherits: "accounts" do |t|
|
@@ -73,12 +92,6 @@ ctiveRecord::Schema.define(version: 20160910024954) do
|
|
73
92
|
end
|
74
93
|
```
|
75
94
|
|
76
|
-
### In your application code
|
77
|
-
|
78
|
-
ActiveRecord queries work as usual with the following differences:
|
79
|
-
|
80
|
-
* The default query of "*" is changed to include the OID of each row for subclass discrimination. The default select will be `SELECT cast("accounts"."tableoid"::regclass AS text), "accounts".*`
|
81
|
-
|
82
95
|
## Contributing
|
83
96
|
|
84
97
|
1. Fork it ( https://github.com/[my-github-username]/active_record-mti/fork )
|
data/active_record-mti.gemspec
CHANGED
@@ -8,23 +8,36 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = ActiveRecord::MTI::VERSION
|
9
9
|
spec.authors = ["Dale Stevens"]
|
10
10
|
spec.email = ["dale@twilightcoders.net"]
|
11
|
+
|
11
12
|
spec.summary = %q{Multi Table Inheritance for PostgreSQL in Rails}
|
12
13
|
spec.description = %q{Allows use of native inherited tables in PostgreSQL}
|
13
14
|
spec.homepage = ""
|
14
15
|
spec.license = "MIT"
|
15
16
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
17
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
18
|
+
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
19
|
+
if spec.respond_to?(:metadata)
|
20
|
+
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
21
|
+
else
|
22
|
+
raise 'RubyGems 2.0 or newer is required to protect against public gem pushes.'
|
23
|
+
end
|
24
|
+
|
25
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
26
|
+
spec.bindir = 'exe'
|
27
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
28
|
+
spec.require_paths = ['lib']
|
20
29
|
|
21
|
-
|
22
|
-
spec.
|
30
|
+
rails_versions = ['>= 4.1', '< 5']
|
31
|
+
spec.required_ruby_version = '>= 2.0.0'
|
23
32
|
|
24
|
-
spec.
|
33
|
+
spec.add_runtime_dependency 'pg', '~> 0'
|
34
|
+
spec.add_runtime_dependency 'activerecord', rails_versions
|
25
35
|
|
26
|
-
spec.
|
27
|
-
spec.
|
28
|
-
spec.
|
36
|
+
spec.add_development_dependency 'pry-byebug'
|
37
|
+
spec.add_development_dependency 'bundler', '~> 1.3'
|
38
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
39
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
40
|
+
spec.add_development_dependency "simplecov", ['>= 0.9.0', '<1.0.0']
|
41
|
+
spec.add_development_dependency "codeclimate-test-reporter", "~> 1.0"
|
29
42
|
|
30
43
|
end
|
data/lib/active_record/mti.rb
CHANGED
@@ -1,22 +1,27 @@
|
|
1
1
|
require 'active_record/mti/version'
|
2
|
-
require 'active_record/mti/railtie'
|
3
2
|
require 'active_record'
|
4
3
|
require 'active_record/connection_handling'
|
5
4
|
require 'active_record/mti/schema_dumper'
|
6
5
|
require 'active_record/mti/inheritance'
|
6
|
+
require 'active_record/mti/model_schema'
|
7
7
|
require 'active_record/mti/query_methods'
|
8
8
|
require 'active_record/mti/calculations'
|
9
9
|
require 'active_record/mti/connection_adapters/postgresql/schema_statements'
|
10
10
|
|
11
|
+
require 'active_record/mti/railtie' if defined?(Rails::Railtie)
|
12
|
+
|
11
13
|
module ActiveRecord
|
12
14
|
module MTI
|
13
|
-
|
15
|
+
|
16
|
+
def self.root
|
17
|
+
@root ||= Pathname.new(File.expand_path('../../', File.dirname(__FILE__)))
|
18
|
+
end
|
19
|
+
|
14
20
|
def self.load
|
15
|
-
puts "ActiveRecord::MTI loaded"
|
16
21
|
::ActiveRecord::Base.send :include, Inheritance
|
22
|
+
::ActiveRecord::Base.send :include, ActiveRecord::MTI::ModelSchema
|
17
23
|
::ActiveRecord::Relation.send :include, QueryMethods
|
18
24
|
::ActiveRecord::Relation.send :include, ActiveRecord::MTI::Calculations
|
19
|
-
|
20
25
|
::ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.send :include, ConnectionAdapters::PostgreSQL::SchemaStatements
|
21
26
|
::ActiveRecord::SchemaDumper.send :include, ActiveRecord::MTI::SchemaDumper
|
22
27
|
end
|
@@ -52,7 +52,7 @@ module ActiveRecord
|
|
52
52
|
relation.select_values = select_values
|
53
53
|
|
54
54
|
# Remove our cast otherwise PSQL will insist that it be included in the GROUP
|
55
|
-
relation.arel.projections.select!{ |p| p.to_s != "
|
55
|
+
relation.arel.projections.select!{ |p| p.to_s != "CAST(\"#{klass.table_name}\".\"tableoid\"::regclass AS text)" } if @klass.using_multi_table_inheritance?
|
56
56
|
|
57
57
|
calculated_data = @klass.connection.select_all(relation, nil, relation.arel.bind_values + bind_values)
|
58
58
|
|
@@ -102,7 +102,7 @@ module ActiveRecord
|
|
102
102
|
|
103
103
|
# Remove our cast otherwise PSQL will insist that it be included in the GROUP
|
104
104
|
# Somewhere between line 82 and 101 relation.arel.projections gets reset :/
|
105
|
-
relation.arel.projections.select!{ |p| p.to_s != "
|
105
|
+
relation.arel.projections.select!{ |p| p.to_s != "CAST(\"#{klass.table_name}\".\"tableoid\"::regclass AS text)" } if @klass.using_multi_table_inheritance?
|
106
106
|
|
107
107
|
query_builder = relation.arel
|
108
108
|
bind_values = query_builder.bind_values + relation.bind_values
|
@@ -61,8 +61,15 @@ module ActiveRecord
|
|
61
61
|
if parent_table
|
62
62
|
parent_table_primary_key = primary_key(parent_table)
|
63
63
|
execute %Q(ALTER TABLE "#{table_name}" ADD PRIMARY KEY ("#{parent_table_primary_key}"))
|
64
|
+
|
65
|
+
|
64
66
|
indexes(parent_table).each do |index|
|
65
|
-
|
67
|
+
attributes = index.to_h.slice(:unique, :using, :where, :orders)
|
68
|
+
|
69
|
+
# Why rails insists on being inconsistant with itself is beyond me.
|
70
|
+
attributes[:order] = attributes.delete(:orders)
|
71
|
+
|
72
|
+
add_index table_name, index.columns, attributes
|
66
73
|
end
|
67
74
|
# triggers_for_table(parent_table).each do |trigger|
|
68
75
|
# name = trigger.first
|
@@ -76,14 +83,13 @@ module ActiveRecord
|
|
76
83
|
|
77
84
|
# Parent of inherited table
|
78
85
|
def parent_tables(table_name)
|
79
|
-
|
86
|
+
result = exec_query(<<-SQL, "SCHEMA")
|
80
87
|
SELECT pg_namespace.nspname, pg_class.relname
|
81
88
|
FROM pg_catalog.pg_inherits
|
82
89
|
INNER JOIN pg_catalog.pg_class ON (pg_inherits.inhparent = pg_class.oid)
|
83
90
|
INNER JOIN pg_catalog.pg_namespace ON (pg_class.relnamespace = pg_namespace.oid)
|
84
91
|
WHERE inhrelid = '#{table_name}'::regclass
|
85
92
|
SQL
|
86
|
-
result = exec_query(sql, "SCHEMA")
|
87
93
|
result.map{|a| a['relname']}
|
88
94
|
end
|
89
95
|
|
@@ -25,20 +25,30 @@ module ActiveRecord
|
|
25
25
|
module Inheritance
|
26
26
|
extend ActiveSupport::Concern
|
27
27
|
|
28
|
+
included do
|
29
|
+
scope :discern_inheritance, -> {
|
30
|
+
|
31
|
+
}
|
32
|
+
end
|
33
|
+
|
28
34
|
module ClassMethods
|
29
35
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
36
|
+
def inherited(child)
|
37
|
+
child.uses_mti if self.uses_mti?
|
38
|
+
super
|
39
|
+
end
|
40
|
+
|
41
|
+
def uses_mti
|
42
|
+
self.inheritance_column = nil
|
43
|
+
@uses_mti = true
|
44
|
+
end
|
45
|
+
|
34
46
|
def using_multi_table_inheritance?(klass = self)
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
false
|
41
|
-
end
|
47
|
+
klass.uses_mti?
|
48
|
+
end
|
49
|
+
|
50
|
+
def uses_mti?
|
51
|
+
@uses_mti ||= false
|
42
52
|
end
|
43
53
|
|
44
54
|
private
|
@@ -47,10 +57,10 @@ module ActiveRecord
|
|
47
57
|
# record instance. For single-table inheritance, we check the record
|
48
58
|
# for a +type+ column and return the corresponding class.
|
49
59
|
def discriminate_class_for_record(record)
|
50
|
-
if
|
51
|
-
find_sti_class(record[inheritance_column])
|
52
|
-
elsif using_multi_table_inheritance?(base_class)
|
60
|
+
if using_multi_table_inheritance?(base_class)
|
53
61
|
find_mti_class(record)
|
62
|
+
elsif using_single_table_inheritance?(record)
|
63
|
+
find_sti_class(record[inheritance_column])
|
54
64
|
else
|
55
65
|
super
|
56
66
|
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module ActiveRecord
|
2
|
+
module MTI
|
3
|
+
module ModelSchema
|
4
|
+
extend ActiveSupport::Concern
|
5
|
+
|
6
|
+
|
7
|
+
module ClassMethods
|
8
|
+
|
9
|
+
# Computes the table name, (re)sets it internally, and returns it.
|
10
|
+
def reset_table_name #:nodoc:
|
11
|
+
# binding.pry
|
12
|
+
self.table_name = if abstract_class?
|
13
|
+
superclass == Base ? nil : superclass.table_name
|
14
|
+
elsif superclass.abstract_class? || superclass.using_multi_table_inheritance?
|
15
|
+
superclass.table_name || compute_table_name
|
16
|
+
else
|
17
|
+
compute_table_name
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -6,7 +6,7 @@ module ActiveRecord
|
|
6
6
|
|
7
7
|
# Retrieve the OID as well on a default select
|
8
8
|
def build_select(arel)
|
9
|
-
arel.project(
|
9
|
+
arel.project(tableoid_cast(@klass)) if @klass.using_multi_table_inheritance?
|
10
10
|
# arel.project("\"#{klass.table_name}\".\"tableoid\"::regclass as \"#{klass.inheritance_column}\"") if @klass.using_multi_table_inheritance?
|
11
11
|
if select_values.any?
|
12
12
|
arel.project(*arel_columns(select_values.uniq))
|
@@ -15,6 +15,12 @@ module ActiveRecord
|
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
|
+
def tableoid_cast(klass)
|
19
|
+
# Arel::Nodes::NamedFunction.new('CAST', [klass.arel_table[:tableoid].as('regclass')])
|
20
|
+
# Arel::Nodes::NamedFunction.new('CAST', [@klass.arel_table['tableoid::regclass'].as('regclass')])
|
21
|
+
"CAST(\"#{klass.table_name}\".\"tableoid\"::regclass AS text)"
|
22
|
+
end
|
23
|
+
|
18
24
|
end
|
19
25
|
end
|
20
26
|
end
|
metadata
CHANGED
@@ -1,117 +1,139 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_record-mti
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dale Stevens
|
8
8
|
autorequire:
|
9
|
-
bindir:
|
9
|
+
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: pg
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
20
|
-
type: :
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: activerecord
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '4.1'
|
34
|
+
- - "<"
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: '5'
|
37
|
+
type: :runtime
|
38
|
+
prerelease: false
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '4.1'
|
44
|
+
- - "<"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '5'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: pry-byebug
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
32
52
|
- !ruby/object:Gem::Version
|
33
53
|
version: '0'
|
34
54
|
type: :development
|
35
55
|
prerelease: false
|
36
56
|
version_requirements: !ruby/object:Gem::Requirement
|
37
57
|
requirements:
|
38
|
-
- - "
|
58
|
+
- - ">="
|
39
59
|
- !ruby/object:Gem::Version
|
40
60
|
version: '0'
|
41
61
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
62
|
+
name: bundler
|
43
63
|
requirement: !ruby/object:Gem::Requirement
|
44
64
|
requirements:
|
45
65
|
- - "~>"
|
46
66
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
48
|
-
type: :
|
67
|
+
version: '1.3'
|
68
|
+
type: :development
|
49
69
|
prerelease: false
|
50
70
|
version_requirements: !ruby/object:Gem::Requirement
|
51
71
|
requirements:
|
52
72
|
- - "~>"
|
53
73
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
74
|
+
version: '1.3'
|
55
75
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
76
|
+
name: rake
|
57
77
|
requirement: !ruby/object:Gem::Requirement
|
58
78
|
requirements:
|
59
79
|
- - "~>"
|
60
80
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
62
|
-
|
63
|
-
- !ruby/object:Gem::Version
|
64
|
-
version: '4.1'
|
65
|
-
type: :runtime
|
81
|
+
version: '10.0'
|
82
|
+
type: :development
|
66
83
|
prerelease: false
|
67
84
|
version_requirements: !ruby/object:Gem::Requirement
|
68
85
|
requirements:
|
69
86
|
- - "~>"
|
70
87
|
- !ruby/object:Gem::Version
|
71
|
-
version: '
|
72
|
-
- - ">"
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
version: '4.1'
|
88
|
+
version: '10.0'
|
75
89
|
- !ruby/object:Gem::Dependency
|
76
|
-
name:
|
90
|
+
name: rspec
|
77
91
|
requirement: !ruby/object:Gem::Requirement
|
78
92
|
requirements:
|
79
93
|
- - "~>"
|
80
94
|
- !ruby/object:Gem::Version
|
81
|
-
version: '
|
82
|
-
|
83
|
-
- !ruby/object:Gem::Version
|
84
|
-
version: '4.1'
|
85
|
-
type: :runtime
|
95
|
+
version: '3.0'
|
96
|
+
type: :development
|
86
97
|
prerelease: false
|
87
98
|
version_requirements: !ruby/object:Gem::Requirement
|
88
99
|
requirements:
|
89
100
|
- - "~>"
|
90
101
|
- !ruby/object:Gem::Version
|
91
|
-
version: '
|
92
|
-
- - ">"
|
93
|
-
- !ruby/object:Gem::Version
|
94
|
-
version: '4.1'
|
102
|
+
version: '3.0'
|
95
103
|
- !ruby/object:Gem::Dependency
|
96
|
-
name:
|
104
|
+
name: simplecov
|
97
105
|
requirement: !ruby/object:Gem::Requirement
|
98
106
|
requirements:
|
99
|
-
- - "
|
107
|
+
- - ">="
|
100
108
|
- !ruby/object:Gem::Version
|
101
|
-
version:
|
102
|
-
- - "
|
109
|
+
version: 0.9.0
|
110
|
+
- - "<"
|
103
111
|
- !ruby/object:Gem::Version
|
104
|
-
version:
|
105
|
-
type: :
|
112
|
+
version: 1.0.0
|
113
|
+
type: :development
|
106
114
|
prerelease: false
|
107
115
|
version_requirements: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
117
|
+
- - ">="
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: 0.9.0
|
120
|
+
- - "<"
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
version: 1.0.0
|
123
|
+
- !ruby/object:Gem::Dependency
|
124
|
+
name: codeclimate-test-reporter
|
125
|
+
requirement: !ruby/object:Gem::Requirement
|
108
126
|
requirements:
|
109
127
|
- - "~>"
|
110
128
|
- !ruby/object:Gem::Version
|
111
|
-
version: '
|
112
|
-
|
129
|
+
version: '1.0'
|
130
|
+
type: :development
|
131
|
+
prerelease: false
|
132
|
+
version_requirements: !ruby/object:Gem::Requirement
|
133
|
+
requirements:
|
134
|
+
- - "~>"
|
113
135
|
- !ruby/object:Gem::Version
|
114
|
-
version: '
|
136
|
+
version: '1.0'
|
115
137
|
description: Allows use of native inherited tables in PostgreSQL
|
116
138
|
email:
|
117
139
|
- dale@twilightcoders.net
|
@@ -120,8 +142,9 @@ extensions: []
|
|
120
142
|
extra_rdoc_files: []
|
121
143
|
files:
|
122
144
|
- ".gitignore"
|
145
|
+
- ".rspec"
|
146
|
+
- ".travis.yml"
|
123
147
|
- Gemfile
|
124
|
-
- Gemfile.lock
|
125
148
|
- LICENSE.txt
|
126
149
|
- README.md
|
127
150
|
- Rakefile
|
@@ -130,6 +153,7 @@ files:
|
|
130
153
|
- lib/active_record/mti/calculations.rb
|
131
154
|
- lib/active_record/mti/connection_adapters/postgresql/schema_statements.rb
|
132
155
|
- lib/active_record/mti/inheritance.rb
|
156
|
+
- lib/active_record/mti/model_schema.rb
|
133
157
|
- lib/active_record/mti/query_methods.rb
|
134
158
|
- lib/active_record/mti/querying.rb
|
135
159
|
- lib/active_record/mti/railtie.rb
|
@@ -138,7 +162,8 @@ files:
|
|
138
162
|
homepage: ''
|
139
163
|
licenses:
|
140
164
|
- MIT
|
141
|
-
metadata:
|
165
|
+
metadata:
|
166
|
+
allowed_push_host: https://rubygems.org
|
142
167
|
post_install_message:
|
143
168
|
rdoc_options: []
|
144
169
|
require_paths:
|
@@ -147,7 +172,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
147
172
|
requirements:
|
148
173
|
- - ">="
|
149
174
|
- !ruby/object:Gem::Version
|
150
|
-
version:
|
175
|
+
version: 2.0.0
|
151
176
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
152
177
|
requirements:
|
153
178
|
- - ">="
|
@@ -155,7 +180,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
155
180
|
version: '0'
|
156
181
|
requirements: []
|
157
182
|
rubyforge_project:
|
158
|
-
rubygems_version: 2.
|
183
|
+
rubygems_version: 2.6.11
|
159
184
|
signing_key:
|
160
185
|
specification_version: 4
|
161
186
|
summary: Multi Table Inheritance for PostgreSQL in Rails
|
data/Gemfile.lock
DELETED
@@ -1,80 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
active_record-mti (0.0.6)
|
5
|
-
activerecord (~> 4.1, > 4.1)
|
6
|
-
activesupport (~> 4.1, > 4.1)
|
7
|
-
pg (~> 0)
|
8
|
-
railties (~> 4.1, > 4.1)
|
9
|
-
|
10
|
-
GEM
|
11
|
-
remote: https://rubygems.org/
|
12
|
-
specs:
|
13
|
-
actionpack (4.2.8)
|
14
|
-
actionview (= 4.2.8)
|
15
|
-
activesupport (= 4.2.8)
|
16
|
-
rack (~> 1.6)
|
17
|
-
rack-test (~> 0.6.2)
|
18
|
-
rails-dom-testing (~> 1.0, >= 1.0.5)
|
19
|
-
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
20
|
-
actionview (4.2.8)
|
21
|
-
activesupport (= 4.2.8)
|
22
|
-
builder (~> 3.1)
|
23
|
-
erubis (~> 2.7.0)
|
24
|
-
rails-dom-testing (~> 1.0, >= 1.0.5)
|
25
|
-
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
26
|
-
activemodel (4.2.8)
|
27
|
-
activesupport (= 4.2.8)
|
28
|
-
builder (~> 3.1)
|
29
|
-
activerecord (4.2.8)
|
30
|
-
activemodel (= 4.2.8)
|
31
|
-
activesupport (= 4.2.8)
|
32
|
-
arel (~> 6.0)
|
33
|
-
activesupport (4.2.8)
|
34
|
-
i18n (~> 0.7)
|
35
|
-
minitest (~> 5.1)
|
36
|
-
thread_safe (~> 0.3, >= 0.3.4)
|
37
|
-
tzinfo (~> 1.1)
|
38
|
-
arel (6.0.4)
|
39
|
-
builder (3.2.3)
|
40
|
-
erubis (2.7.0)
|
41
|
-
i18n (0.8.1)
|
42
|
-
loofah (2.0.3)
|
43
|
-
nokogiri (>= 1.5.9)
|
44
|
-
mini_portile2 (2.1.0)
|
45
|
-
minitest (5.10.1)
|
46
|
-
nokogiri (1.7.1)
|
47
|
-
mini_portile2 (~> 2.1.0)
|
48
|
-
pg (0.20.0)
|
49
|
-
rack (1.6.5)
|
50
|
-
rack-test (0.6.3)
|
51
|
-
rack (>= 1.0)
|
52
|
-
rails-deprecated_sanitizer (1.0.3)
|
53
|
-
activesupport (>= 4.2.0.alpha)
|
54
|
-
rails-dom-testing (1.0.8)
|
55
|
-
activesupport (>= 4.2.0.beta, < 5.0)
|
56
|
-
nokogiri (~> 1.6)
|
57
|
-
rails-deprecated_sanitizer (>= 1.0.1)
|
58
|
-
rails-html-sanitizer (1.0.3)
|
59
|
-
loofah (~> 2.0)
|
60
|
-
railties (4.2.8)
|
61
|
-
actionpack (= 4.2.8)
|
62
|
-
activesupport (= 4.2.8)
|
63
|
-
rake (>= 0.8.7)
|
64
|
-
thor (>= 0.18.1, < 2.0)
|
65
|
-
rake (0.9.6)
|
66
|
-
thor (0.19.4)
|
67
|
-
thread_safe (0.3.6)
|
68
|
-
tzinfo (1.2.3)
|
69
|
-
thread_safe (~> 0.1)
|
70
|
-
|
71
|
-
PLATFORMS
|
72
|
-
ruby
|
73
|
-
|
74
|
-
DEPENDENCIES
|
75
|
-
active_record-mti!
|
76
|
-
bundler (~> 1.6)
|
77
|
-
rake (~> 0)
|
78
|
-
|
79
|
-
BUNDLED WITH
|
80
|
-
1.13.6
|