better_record 0.7.4 → 0.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 94df7b6da46f92b60e919c133f8edbafb7ac12e94f788eee4e6758a52c543117
4
- data.tar.gz: d428301141dde9bb44c6b4429fd54c6e778d38660d52726cbd06f2d35e48bd22
3
+ metadata.gz: d29d2bc0753e584821d26b2fab8982433e35804b987d12f4b0dd041b0aacfa74
4
+ data.tar.gz: 1c2f52a0da7eaf5006bc5f7c37cb8d88a76c8f0b36f5f871e8e718cc09359062
5
5
  SHA512:
6
- metadata.gz: 6069a0623d01c671f6cc4298e1a485d9e683375fba97a0faee820af592ed7b73ce3adc627aef512aa451a236ee6ea75120a0ef7e4f359126ad8721abdc5a8e1c
7
- data.tar.gz: c897040fb775b7c0b24d0e6f698aa1bafbee097fe5815b53d17ebaafc2e171e928def860d65ec362a64b1356ca3a8514ffbb9380ad3376d787e093b47ffb41d5
6
+ metadata.gz: 9f665aa3dd58974cc2923d0a0f68115dc7060d7e6875e6babcbeefc2d8a6c6606074bbf895c0ef21b377560adaf8ffdf935e1e90707c194ce6293dc946047969
7
+ data.tar.gz: c4bd9c386f1072514d7bc63034fc29615e4263f5cc51315681997ea9c0be8833d4428fa39d60718ffb45bdd924762612120c84f01b10e2a3fe8416b2e76f75d5
@@ -1,3 +1,3 @@
1
1
  module BetterRecord
2
- VERSION = '0.7.4'
2
+ VERSION = '0.7.5'
3
3
  end
@@ -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
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-27 00:00:00.000000000 Z
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.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