Skip to content

Commit 815fb0a

Browse files
authored
Fixes Issue #16 by including missing methods (#18)
* Fixes Issue #16 by including missing methods This fixes the error which occurred when running rails g devise_two_factor User on a properly configured application. * Adds missing manifest.js to Dummy application. * Fixes devise_error_messages! deprecation, upgrades Devise to '~> 4.6' * Fixes sqlite3.represent_boolean_as_integer deprecation warning. * Upgrade version and changelong
1 parent a3e1d9c commit 815fb0a

8 files changed

Lines changed: 27 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## [0.4.1] - 2019-10-31
10+
### Changed
11+
- Adds missing methods to ActiveRecord generator to fix issue #16.
12+
- Adds a missing manifest.js to Dummy application.
13+
- Fixes devise_error_messages! deprecation warning by using the new partial.
14+
- Fixes sqlite3.represent_boolean_as_integer deprecation warning in specs.
15+
916
## [0.4.0] - 2019-08-22
1017
### Added
1118
- Appraisal suite.

app/views/devise/credentials/refresh.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<%= form_for(resource, as: resource_name, url: [:refresh, resource_name, :credential], html: { method: :put }) do |f| %>
55

6-
<%= devise_error_messages! %>
6+
<%= render "devise/shared/error_messages", resource: resource %>
77

88
<div><%= f.label :email %><br />
99
<%= f.text_field :email, disabled: :true%></div>

app/views/devise/tokens/show.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<%= form_for(resource, as: resource_name, url: [resource_name, :token], html: { method: :put }) do |f| %>
55

6-
<%= devise_error_messages! %>
6+
<%= render "devise/shared/error_messages", resource: resource %>
77

88
<h3><%= I18n.t('enable_request', {scope: 'devise.two_factor.tokens'}) %></h3>
99

devise_2fa.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Gem::Specification.new do |gem|
2020

2121
gem.add_dependency "rails", ">= 4.1", "< 6.1"
2222

23-
gem.add_runtime_dependency 'devise', '~> 4.0'
23+
gem.add_runtime_dependency 'devise', '~> 4.6'
2424
gem.add_runtime_dependency 'rotp', '~> 5.1'
2525
gem.add_runtime_dependency 'rqrcode', '~> 0.10.1'
2626
gem.add_runtime_dependency 'symmetric-encryption', '~> 4.3.0'

lib/devise-2fa/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module Devise
22
module TwoFactor
3-
VERSION = '0.4.0'.freeze
3+
VERSION = '0.4.1'.freeze
44
end
55
end

lib/generators/active_record/devise_two_factor_generator.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@ def content
2727
validates :otp_recovery_secret, symmetric_encryption: true
2828
RUBY
2929
end
30+
31+
private
32+
33+
def model_exists?
34+
File.exist?(File.join(destination_root, model_path))
35+
end
36+
37+
def model_path
38+
@model_path ||= File.join("app", "models", "#{file_path}.rb")
39+
end
3040
end
3141
end
3242
end
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
//= link_tree ../images
2+
//= link_directory ../javascripts .js
3+
//= link_directory ../stylesheets .css

spec/dummy/config/application.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,8 @@
1717
module Dummy
1818
class Application < Rails::Application
1919
config.load_defaults 5.0
20+
unless ENV['BUNDLE_GEMFILE'].include?('mongodb')
21+
Rails.application.config.active_record.sqlite3.represent_boolean_as_integer = true
22+
end
2023
end
2124
end

0 commit comments

Comments
 (0)