authenticate 0.6.0 → 0.6.1

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: a77403e50b229de8318c79477ee44062589afb05
4
- data.tar.gz: c6bf923d8809f923a48cb4211d97dd406b42e03f
3
+ metadata.gz: 2888d491c7df1e767b2bcf58c4581012bb64f56a
4
+ data.tar.gz: 30548171155bd56462c7326a70e4275d5dde2336
5
5
  SHA512:
6
- metadata.gz: 55cd9cb2b412bb87ebe3d6e6a46ce89eebd23147946aaa31b0f7e3fbf566f24bdf237a010be18eb6b1cb785d424821df3e9a55ad798b18b420246d6a18cfa963
7
- data.tar.gz: 5f5f9aeaf98ce47c9ce16d90c7ebcc7930fc58a2013c909fdec27c18979e4fe3b0821a6075eecab22d5433fc7dd21d9071d28cc7493f53116d4fbf18f9000a74
6
+ metadata.gz: bd4d8474083ff62f1f677ef8760f13bdfa9c821c8c7eefcf9461ce691d829cca4af8687fd1d8b51a637b19b752eb25ff7eef2383598ddebf69da7f493f2210c8
7
+ data.tar.gz: 95ef6dffaebefe2cf9e366e099812e625faa5eb0de27b6e549ccef7cd082aaaee876ae45828a4ddc9c49a0e3972e29984134f09ed095ac0c296f1357f225f2c4
@@ -1,5 +1,13 @@
1
1
  # Authenticate Changelog
2
2
 
3
+ ## [0.6.1] - May 16, 2017
4
+
5
+ ### Fixed
6
+ - install migrations now correctly support rails 4.2.x and rails 5.x.
7
+
8
+ [0.6.1]: https://github.com/tomichj/authenticate/compare/v0.6.0...v0.6.1
9
+
10
+
3
11
 
4
12
  ## [0.6.0] - May 16, 2017
5
13
 
@@ -1,3 +1,3 @@
1
1
  module Authenticate
2
- VERSION = '0.6.0'.freeze
2
+ VERSION = '0.6.1'.freeze
3
3
  end
@@ -91,11 +91,12 @@ module Authenticate
91
91
  end
92
92
 
93
93
  def copy_migration(migration_name, config = {})
94
+ puts "migration_version: #{migration_version}"
94
95
  unless migration_exists?(migration_name)
95
96
  migration_template(
96
97
  "db/migrate/#{migration_name}",
97
98
  "db/migrate/#{migration_name}",
98
- config
99
+ config.merge(migration_version: migration_version)
99
100
  )
100
101
  end
101
102
  end
@@ -162,6 +163,12 @@ module Authenticate
162
163
  def model_base_class
163
164
  (Rails.version >= '5.0.0') ? 'ApplicationRecord' : 'ActiveRecord::Base'
164
165
  end
166
+
167
+ def migration_version
168
+ if Rails.version >= '5.0.0'
169
+ "[#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}]"
170
+ end
171
+ end
165
172
  end
166
173
  end
167
174
  end
@@ -1,4 +1,4 @@
1
- class AddAuthenticateBruteForceToUsers < ActiveRecord::Migration
1
+ class AddAuthenticateBruteForceToUsers < ActiveRecord::Migration<%= migration_version %>
2
2
  def change
3
3
  add_column :<%= table_name %>, :failed_logins_count, :integer, default: 0
4
4
  add_column :<%= table_name %>, :lock_expires_at, :datetime, default: nil
@@ -1,4 +1,4 @@
1
- class AddAuthenticatePasswordResetToUsers < ActiveRecord::Migration
1
+ class AddAuthenticatePasswordResetToUsers < ActiveRecord::Migration<%= migration_version %>
2
2
  def change
3
3
  add_column :<%= table_name %>, :password_reset_token, :string, default: nil
4
4
  add_column :<%= table_name %>, :password_reset_sent_at, :datetime, default: nil
@@ -1,4 +1,4 @@
1
- class AddAuthenticateTimeoutableToUsers < ActiveRecord::Migration
1
+ class AddAuthenticateTimeoutableToUsers < ActiveRecord::Migration<%= migration_version %>
2
2
  def change
3
3
  add_column :<%= table_name %>, :last_access_at, :datetime, default: nil
4
4
  end
@@ -1,4 +1,4 @@
1
- class AddAuthenticateToUsers < ActiveRecord::Migration
1
+ class AddAuthenticateToUsers < ActiveRecord::Migration<%= migration_version %>
2
2
  def self.up
3
3
  change_table :<%= table_name %> do |t|
4
4
  <% config[:new_columns].values.each do |column| -%>
@@ -1,4 +1,4 @@
1
- class CreateUsers < ActiveRecord::Migration
1
+ class CreateUsers < ActiveRecord::Migration<%= migration_version %>
2
2
  def change
3
3
  create_table :<%= table_name %> do |t|
4
4
  <% config[:new_columns].values.each do |column| -%>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: authenticate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Tomich
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-16 00:00:00.000000000 Z
11
+ date: 2017-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bcrypt