schema_associations 1.2.5 → 1.2.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dc1905f1df57594ba2e456f9453099827e62df17
4
- data.tar.gz: f85030cb99925c5589c9499cbde3f21d177b01fc
3
+ metadata.gz: c080f0a0fd14c82a61269dc1eb6e1e111ed1c331
4
+ data.tar.gz: 6e0a834bf340751c07ec3614ca34a712c35e884e
5
5
  SHA512:
6
- metadata.gz: d747c0d7bb98aff9f230d91ec4c67d6f78d6b6d7ab75473d6486f5a8dfca9b839c949c8b3b34f41b7e0a0c42be2809cbf9f748ff47e6c7a9028262718284e15e
7
- data.tar.gz: 8335b7d788b8fdc5f35fec400892ce3850c5227038d7a9ade9faa872c8fee03dcd71c3af340d097bd75d6fc9321fc282616accfec189ed31352fb41929922a8f
6
+ metadata.gz: 06b8e5871f6cb1ee9751571a739a05560c2f5f6d787450e3c69d893e3fa2cb43875778e1f7022c6d5436baba937ddbb29e903bba0de1798904bb7743c9fa3328
7
+ data.tar.gz: 4101db526873abab3e101e0bf8852f55372c272fe9c116169243a676d278455defe4c18b752c6fcf71d6ba99c54154084fe8dc851b792bb2af8aa5b860d8ddc4
@@ -5,11 +5,14 @@
5
5
  ---
6
6
  sudo: false
7
7
  rvm:
8
- - 2.1.5
8
+ - 2.3.1
9
9
  gemfile:
10
10
  - gemfiles/activerecord-4.2/Gemfile.mysql2
11
11
  - gemfiles/activerecord-4.2/Gemfile.postgresql
12
12
  - gemfiles/activerecord-4.2/Gemfile.sqlite3
13
+ - gemfiles/activerecord-5.0/Gemfile.mysql2
14
+ - gemfiles/activerecord-5.0/Gemfile.postgresql
15
+ - gemfiles/activerecord-5.0/Gemfile.sqlite3
13
16
  env: POSTGRESQL_DB_USER=postgres MYSQL_DB_USER=travis
14
17
  addons:
15
18
  postgresql: '9.4'
data/README.md CHANGED
@@ -87,7 +87,7 @@ class Post < ActiveRecord::Base
87
87
  end
88
88
  ```
89
89
 
90
- You can also pass options as described in [Configurtion](#configuration)
90
+ You can also pass options as described in [Configuration](#configuration)
91
91
 
92
92
  ## Full Details
93
93
 
@@ -303,7 +303,7 @@ end
303
303
 
304
304
  ## Table names, model class names, and modules
305
305
 
306
- SchemaAssociations determins the mode class name from the table name using the same convention (and helpers) that ActiveRecord uses. But sometimes you might be doing things differently. For example, in an engine you might have a prefix that goes in front of all table names, and the models might all be namespaced in a module.
306
+ SchemaAssociations determines the model class name from the table name using the same convention (and helpers) that ActiveRecord uses. But sometimes you might be doing things differently. For example, in an engine you might have a prefix that goes in front of all table names, and the models might all be namespaced in a module.
307
307
 
308
308
  To that end, SchemaAssociations lets you configure mappings from a table name prefix to a model class name prefix to use instead. For example, suppose your database had tables:
309
309
 
@@ -336,7 +336,7 @@ end
336
336
 
337
337
  Tables names that don't start with `hpy_` will continue to use the default determination.
338
338
 
339
- You can set up multiple mappings. E.g. if you're using several engines they can each set up the mapping for their own moduels.
339
+ You can set up multiple mappings. E.g. if you're using several engines they can each set up the mapping for their own modules.
340
340
 
341
341
  You can set up a mapping from or to the empty string, in order to unconditionally add or remove prefixes from all model class names.
342
342
 
@@ -418,7 +418,8 @@ SchemaAssociations is tested on all combinations of:
418
418
 
419
419
  <!-- SCHEMA_DEV: MATRIX - begin -->
420
420
  <!-- These lines are auto-generated by schema_dev based on schema_dev.yml -->
421
- * ruby **2.1.5** with activerecord **4.2**, using **mysql2**, **postgresql** or **sqlite3**
421
+ * ruby **2.3.1** with activerecord **4.2**, using **mysql2**, **postgresql** or **sqlite3**
422
+ * ruby **2.3.1** with activerecord **5.0**, using **mysql2**, **postgresql** or **sqlite3**
422
423
 
423
424
  <!-- SCHEMA_DEV: MATRIX - end -->
424
425
 
@@ -453,6 +454,10 @@ Code coverage results will be in coverage/index.html -- it should be at 100% cov
453
454
 
454
455
  ## Release notes:
455
456
 
457
+ ### 1.2.6
458
+
459
+ * Support for AR5 (Rails 5).
460
+
456
461
  ### 1.2.5
457
462
 
458
463
  * Use schema_monkey rather than Railties.
@@ -1,3 +1,3 @@
1
1
  eval File.read File.expand_path('../../Gemfile.base', __FILE__)
2
2
 
3
- gem "activerecord", "~> 4.2.0"
3
+ gem "activerecord", "~> 4.2.6"
@@ -2,9 +2,9 @@ require "pathname"
2
2
  eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
3
3
 
4
4
  platform :ruby do
5
- gem "mysql2"
5
+ gem "mysql2", '>= 0.3.18', '< 0.5'
6
6
  end
7
7
 
8
8
  platform :jruby do
9
9
  gem 'activerecord-jdbcmysql-adapter'
10
- end
10
+ end
@@ -0,0 +1,3 @@
1
+ eval File.read File.expand_path('../../Gemfile.base', __FILE__)
2
+
3
+ gem "activerecord", "~> 5.0.0"
@@ -0,0 +1,10 @@
1
+ require "pathname"
2
+ eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
3
+
4
+ platform :ruby do
5
+ gem "mysql2"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcmysql-adapter'
10
+ end
@@ -0,0 +1,10 @@
1
+ require "pathname"
2
+ eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
3
+
4
+ platform :ruby do
5
+ gem "pg"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcpostgresql-adapter'
10
+ end
@@ -0,0 +1,10 @@
1
+ require "pathname"
2
+ eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
3
+
4
+ platform :ruby do
5
+ gem "sqlite3"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcsqlite3-adapter', '>=1.3.0.beta2'
10
+ end
@@ -70,7 +70,6 @@ module SchemaAssociations
70
70
 
71
71
  def _load_schema_associations_associations
72
72
  return if @schema_associations_associations_loaded
73
- @schema_associations_associations_loaded = true
74
73
  return if abstract_class?
75
74
  return unless schema_associations_config.auto_create?
76
75
 
@@ -90,6 +89,8 @@ module SchemaAssociations
90
89
  foreign_keys.each do | foreign_key |
91
90
  _define_association(:belongs_to, foreign_key)
92
91
  end
92
+
93
+ @schema_associations_associations_loaded = true
93
94
  end
94
95
 
95
96
  def _define_association(macro, fk, referencing_table_name = nil)
@@ -1,3 +1,3 @@
1
1
  module SchemaAssociations
2
- VERSION = "1.2.5"
2
+ VERSION = "1.2.6"
3
3
  end
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
21
21
 
22
22
  s.add_dependency("schema_plus_foreign_keys", "~> 0.1")
23
23
 
24
- s.add_development_dependency("schema_dev", "~> 3.5")
24
+ s.add_development_dependency("schema_dev", "~> 3.6")
25
25
  s.add_development_dependency("rake")
26
26
  s.add_development_dependency("rdoc")
27
27
  s.add_development_dependency("rspec")
@@ -1,11 +1,12 @@
1
1
  ruby:
2
- - 2.1.5
2
+ - 2.3.1
3
3
  activerecord:
4
4
  - 4.2
5
+ - 5.0
5
6
  db:
6
7
  - mysql2
7
8
  - postgresql
8
9
  - sqlite3
9
10
  notify:
10
- - toby@ovod-everett.org
11
- - ronen@barzel.org
11
+ - toby@ovod-everett.org
12
+ - ronen@barzel.org
@@ -696,7 +696,7 @@ describe ActiveRecord::Base do
696
696
 
697
697
  def create_tables(*table_defs)
698
698
  ActiveRecord::Migration.suppress_messages do
699
- ActiveRecord::Base.connection.tables.each do |table|
699
+ ActiveRecord::Base.connection.tables_only.each do |table|
700
700
  ActiveRecord::Migration.drop_table table, force: :cascade
701
701
  end
702
702
  table_defs.each_slice(3) do |table_name, opts, columns_with_options|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: schema_associations
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.5
4
+ version: 1.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ronen Barzel
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-03-17 00:00:00.000000000 Z
12
+ date: 2016-09-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: schema_plus_foreign_keys
@@ -31,14 +31,14 @@ dependencies:
31
31
  requirements:
32
32
  - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: '3.5'
34
+ version: '3.6'
35
35
  type: :development
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: '3.5'
41
+ version: '3.6'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: rake
44
44
  requirement: !ruby/object:Gem::Requirement
@@ -132,6 +132,10 @@ files:
132
132
  - gemfiles/activerecord-4.2/Gemfile.mysql2
133
133
  - gemfiles/activerecord-4.2/Gemfile.postgresql
134
134
  - gemfiles/activerecord-4.2/Gemfile.sqlite3
135
+ - gemfiles/activerecord-5.0/Gemfile.base
136
+ - gemfiles/activerecord-5.0/Gemfile.mysql2
137
+ - gemfiles/activerecord-5.0/Gemfile.postgresql
138
+ - gemfiles/activerecord-5.0/Gemfile.sqlite3
135
139
  - init.rb
136
140
  - lib/schema_associations.rb
137
141
  - lib/schema_associations/active_record/associations.rb
@@ -160,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
160
164
  version: '0'
161
165
  requirements: []
162
166
  rubyforge_project: schema_associations
163
- rubygems_version: 2.2.2
167
+ rubygems_version: 2.5.1
164
168
  signing_key:
165
169
  specification_version: 4
166
170
  summary: ActiveRecord extension that automatically (DRY) creates associations based