active_record-mti 0.3.2 → 0.4.0.pre.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -6
  3. data/{LICENSE.txt → LICENSE} +0 -0
  4. data/README.md +47 -10
  5. data/lib/active_record/mti.rb +56 -56
  6. data/lib/active_record/mti/config.rb +26 -0
  7. data/lib/active_record/mti/connection_adapters/postgresql/adapter.rb +0 -8
  8. data/lib/active_record/mti/connection_adapters/postgresql/schema_statements.rb +30 -11
  9. data/lib/active_record/mti/core_extension.rb +170 -0
  10. data/lib/active_record/mti/railtie.rb +9 -4
  11. data/lib/active_record/mti/relation.rb +95 -0
  12. data/lib/active_record/mti/schema_dumper.rb +4 -4
  13. data/lib/active_record/mti/table.rb +19 -0
  14. data/lib/active_record/mti/table_oid.rb +6 -0
  15. data/lib/active_record/mti/version.rb +1 -1
  16. data/lib/core_ext/array.rb +14 -0
  17. data/lib/core_ext/hash.rb +1 -3
  18. data/lib/core_ext/thread.rb +14 -0
  19. metadata +94 -95
  20. data/.gitignore +0 -78
  21. data/.rspec +0 -2
  22. data/.travis.yml +0 -38
  23. data/Gemfile +0 -21
  24. data/Rakefile +0 -6
  25. data/active_record-mti.gemspec +0 -42
  26. data/gemfiles/activerecord-4.0.Gemfile +0 -3
  27. data/gemfiles/activerecord-4.1.Gemfile +0 -3
  28. data/gemfiles/activerecord-4.2.Gemfile +0 -3
  29. data/gemfiles/activerecord-5.0.Gemfile +0 -3
  30. data/gemfiles/activerecord-5.1.Gemfile +0 -3
  31. data/lib/active_record/mti/calculations.rb +0 -23
  32. data/lib/active_record/mti/inheritance.rb +0 -127
  33. data/lib/active_record/mti/model_schema.rb +0 -55
  34. data/lib/active_record/mti/query_methods.rb +0 -40
  35. data/lib/active_record/mti/querying.rb +0 -7
  36. data/lib/active_record/mti/registry.rb +0 -23
  37. data/spec/active_record/mti/calculations_spec.rb +0 -56
  38. data/spec/active_record/mti/inheritance_spec.rb +0 -184
  39. data/spec/active_record/mti/model_schema_spec.rb +0 -11
  40. data/spec/active_record/mti/query_methods_spec.rb +0 -12
  41. data/spec/active_record/mti/schema_dumper_spec.rb +0 -22
  42. data/spec/active_record/mti_spec.rb +0 -24
  43. data/spec/active_record/sti/inheritance_spec.rb +0 -24
  44. data/spec/spec_helper.rb +0 -28
  45. data/spec/support/rails/app/models/admin.rb +0 -3
  46. data/spec/support/rails/app/models/comment.rb +0 -4
  47. data/spec/support/rails/app/models/post.rb +0 -4
  48. data/spec/support/rails/app/models/transportation/military/vehicle.rb +0 -7
  49. data/spec/support/rails/app/models/transportation/truck.rb +0 -5
  50. data/spec/support/rails/app/models/transportation/vehicle.rb +0 -4
  51. data/spec/support/rails/app/models/user.rb +0 -6
  52. data/spec/support/rails/config/database.yml +0 -4
  53. data/spec/support/rails/config/routes.rb +0 -3
  54. data/spec/support/rails/db/schema.rb +0 -51
  55. data/spec/support/rails/log/.gitignore +0 -1
  56. data/spec/support/rails/public/favicon.ico +0 -0
@@ -1,6 +0,0 @@
1
- class User < ::ActiveRecord::Base
2
-
3
- has_many :posts
4
- has_many :comments
5
-
6
- end
@@ -1,4 +0,0 @@
1
- test:
2
- adapter: postgresql
3
- encoding: unicode
4
- database: active_record-mti-test
@@ -1,3 +0,0 @@
1
- Rails.application.routes.draw do
2
- #
3
- end
@@ -1,51 +0,0 @@
1
- ActiveRecord::Schema.define do
2
-
3
- enable_extension 'pgcrypto'
4
- enable_extension "uuid-ossp"
5
-
6
- self.verbose = false
7
-
8
- create_table :users, schema: :public, force: true do |t|
9
- t.string :email, index: :btree
10
- t.timestamps null: false
11
- end
12
-
13
- create_table :admins, force: true, inherits: :users do |t|
14
- t.integer :god_powers
15
- end
16
-
17
- create_table 'admin/hackers', force: true, inherits: :admins do |t|
18
- t.integer :god_powers
19
- end
20
-
21
- create_table :posts, id: :bigserial, force: true do |t|
22
- t.integer :user_id
23
- t.string :title
24
- t.timestamps null: false
25
- end
26
-
27
- create_table :post_tags, id: :bigserial, default: nil, primary_key: :post_id, force: true do |t|
28
- t.string :title
29
- t.timestamps null: false
30
- end
31
-
32
- create_table :comments, force: true do |t|
33
- t.integer :user_id
34
- t.integer :post_id
35
- t.timestamps null: false
36
- end
37
-
38
- #################################
39
- ### Custom Inheritance Column ###
40
- #################################
41
-
42
- create_table :vehicles, force: true do |t|
43
- t.string :color
44
- t.string :type # Inheritance column
45
- t.timestamps null: false
46
- end
47
-
48
- create_table "vehicles/trucks", force: true, inherits: :vehicles do |t|
49
- t.integer :bed_size
50
- end
51
- end
@@ -1 +0,0 @@
1
- *.log
File without changes