globalize-automatic 0.0.5 → 0.0.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: 9e6b61de4bb74485b932ddcd9f32c58c4063148f
4
- data.tar.gz: 718ddcd6b0d1cd9123edaf29616354cd714e9ee3
3
+ metadata.gz: fb2bdc07b52a065892fbf2fe1a62944680b84877
4
+ data.tar.gz: e55cdbdc3711ab995ceff3342fad836d3641cc7d
5
5
  SHA512:
6
- metadata.gz: 2f5b242b1bcf2ebbba3f36f86dd8a36eb46c7f5342eb4083bc67f0eb31cbfa2a65d87272a1d4d955e68abee2144e37399627bc2872ceda6d9e56f63218aca84e
7
- data.tar.gz: a1ef9868578172474eb29f096d4f974fa200e5c1ec26a226768918372d8c359d7be1f1e27381c443ffc1f7d3c501c8bd54ae2e4aab17176c70e88353c6e45169
6
+ metadata.gz: 4a399b52c75a2faa0d4c3a29d3419273d8eba650763441833cf16014859607110a580f99e6dade457d5c7daf49a05869fb96e5613d7df5187faa080b32abadf7
7
+ data.tar.gz: 540c9061ddba4f91e0280c2acd64eaab33a00c94f1e389d4ff31c7fa3fc4c358680dbc2e1a0c43d1ab52aefc082d0d2df2e70b1dfd6833c6eb64d74fec615b81
@@ -1,3 +1,5 @@
1
+ require 'digest/md5'
2
+
1
3
  class Globalize::Automatic::Translation < ActiveRecord::Base
2
4
  self.abstract_class = true
3
5
 
@@ -43,8 +45,9 @@ class Globalize::Automatic::Translation < ActiveRecord::Base
43
45
 
44
46
  class << self
45
47
  def create_table!(*fields)
48
+ relation_name = automatic_translated_model_foreign_key.sub(/_id$/, '')
46
49
  connection.create_table(table_name) do |t|
47
- t.references automatic_translated_model_foreign_key.sub(/_id$/, ''), null: false, index: true
50
+ t.references relation_name, null: false, index: { name: "index_#{Digest::MD5.hexdigest([table_name, relation_name].join('/'))}" }
48
51
  t.string :locale, null: false
49
52
  fields.each do |field|
50
53
  t.boolean *automatically_column_args(field)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Globalize
4
4
  module Automatic
5
- VERSION = '0.0.5'
5
+ VERSION = '0.0.6'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: globalize-automatic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuichi Takeuchi