schema_plus 2.0.0.pre13 → 2.0.0.pre14

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: 097dc1df079f835526329efab67628e6b5c80998
4
- data.tar.gz: 7953ae4520025b892c725a0821246c734ef685ce
3
+ metadata.gz: 1dc664ffb3d969d674d13187eb4a24ed787385c6
4
+ data.tar.gz: 0a0b00cd17a6bad153bf9a002f3360ab5410d8e3
5
5
  SHA512:
6
- metadata.gz: 19cfecf2e4ad25081836fd1fcb976cb111a4c0163254d65e29b4325e4a366c482423bc7657aa97b3c3d6588e6086cccdf910341dc610ca4fa8961b5456aca664
7
- data.tar.gz: c1d32ccfff88705ace650204505aec9887930e0ed0df7e8f623be1e04c2d6c5142f6709b2f1eb5fb9537bed9c89abe32f6d11864b072833dfdcdd768a132ae65
6
+ metadata.gz: e49e502c04c11581a525c83fe450e01fb8c59c198c91d43e857574ef99d523d093b49ad5e2d4b715124e037c8db09a679e46d5b24af55eb44b0620611618d4cc
7
+ data.tar.gz: 9976e6e8f318dd66b732882128922d5bb6c51dccaf530a4eb04a86135265645ab3f9acaa5184ceb1426149546b261dbb290ff633788a019a0b2f8fdfc57cbd5f
data/README.md CHANGED
@@ -35,7 +35,7 @@ See detailed documentation in each gem's README.
35
35
  [![Dependency Status](https://gemnasium.com/lomba/schema_plus.svg)](https://gemnasium.com/SchemaPlus/schema_plus)
36
36
 
37
37
 
38
- > ## This is the README for schema_plus 2.0.0.pre13
38
+ > ## This is the README for schema_plus 2.0.0.pre14
39
39
  > which supports Rails >= 4.2.0. This prerelease is completely usable. It's still officially a prerelease rather than formal release because some features have yet to be migrated into their own gems.
40
40
  >
41
41
  > For info about the 1.x releases which support Rails 3.1, 4.0, 4.1, and 4.2.0, see the [schema_plus 1.x](https://github.com/SchemaPlus/schema_plus/tree/1.x) branch
@@ -33,6 +33,7 @@ module SchemaPlus::ForeignKeys
33
33
 
34
34
  options = options.dup
35
35
  options[:column] ||= foreign_key_column_for(to_table)
36
+ options[:name] ||= ForeignKeyDefinition.default_name(from_table, options[:column])
36
37
 
37
38
  foreign_key_sql = add_foreign_key_sql(from_table, to_table, options)
38
39
  execute "ALTER TABLE #{quote_table_name(from_table)} #{foreign_key_sql}"
@@ -1,3 +1,3 @@
1
1
  module SchemaPlus
2
- VERSION = "2.0.0.pre13"
2
+ VERSION = "2.0.0.pre14"
3
3
  end
@@ -553,6 +553,12 @@ describe ActiveRecord::Migration do
553
553
  SchemaPlus::ForeignKeys.config.on_delete = nil
554
554
  end
555
555
 
556
+ it "should create foreign key with default name" do
557
+ add_column(:post_id, :integer) do
558
+ expect(@model).to reference(:posts, :id).with_name("fk_#{@model.table_name}_post_id")
559
+ end
560
+ end
561
+
556
562
  protected
557
563
  def add_column(column_name, *args)
558
564
  table = @model.table_name
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: schema_plus
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.pre13
4
+ version: 2.0.0.pre14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ronen Barzel