better_record 0.7.4 → 0.7.5
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d29d2bc0753e584821d26b2fab8982433e35804b987d12f4b0dd041b0aacfa74
|
4
|
+
data.tar.gz: 1c2f52a0da7eaf5006bc5f7c37cb8d88a76c8f0b36f5f871e8e718cc09359062
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f665aa3dd58974cc2923d0a0f68115dc7060d7e6875e6babcbeefc2d8a6c6606074bbf895c0ef21b377560adaf8ffdf935e1e90707c194ce6293dc946047969
|
7
|
+
data.tar.gz: c4bd9c386f1072514d7bc63034fc29615e4263f5cc51315681997ea9c0be8833d4428fa39d60718ffb45bdd924762612120c84f01b10e2a3fe8416b2e76f75d5
|
@@ -1,9 +1,11 @@
|
|
1
|
-
class <%= migration_class_name %> < ActiveRecord::Migration
|
1
|
+
class <%= migration_class_name %> < ActiveRecord::Migration[<%= ActiveRecord::Migration.current_version %>]
|
2
2
|
def change
|
3
|
-
create_table :<%= table_name %> do |t|
|
3
|
+
create_table :<%= table_name %><%= primary_key_type %> do |t|
|
4
4
|
<% attributes.each do |attribute| -%>
|
5
5
|
<% if attribute.password_digest? -%>
|
6
6
|
t.string :password_digest<%= attribute.inject_options %>
|
7
|
+
<% elsif attribute.token? -%>
|
8
|
+
t.string :<%= attribute.name %><%= attribute.inject_options %>
|
7
9
|
<% else -%>
|
8
10
|
t.<%= attribute.type %> :<%= attribute.name %><%= attribute.type == :references ? ', null: false' : '' %><%= attribute.inject_options %>
|
9
11
|
<% end -%>
|
@@ -12,6 +14,9 @@ class <%= migration_class_name %> < ActiveRecord::Migration
|
|
12
14
|
t.timestamps default: -> { 'NOW()' }
|
13
15
|
<% end -%>
|
14
16
|
end
|
17
|
+
<% attributes.select(&:token?).each do |attribute| -%>
|
18
|
+
add_index :<%= table_name %>, :<%= attribute.index_name %><%= attribute.inject_index_options %>, unique: true
|
19
|
+
<% end -%>
|
15
20
|
<% attributes_with_index.each do |attribute| -%>
|
16
21
|
add_index :<%= table_name %>, :<%= attribute.index_name %><%= attribute.inject_index_options %>
|
17
22
|
<% end -%>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: better_record
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sampson Crowley
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-07-
|
11
|
+
date: 2018-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -256,7 +256,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
256
256
|
version: '0'
|
257
257
|
requirements: []
|
258
258
|
rubyforge_project:
|
259
|
-
rubygems_version: 2.7.
|
259
|
+
rubygems_version: 2.7.6
|
260
260
|
signing_key:
|
261
261
|
specification_version: 4
|
262
262
|
summary: Fix functions that are lacking in Active record to be compatible with multi-app
|