This repository has been archived by the owner on Feb 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from identification-io/feature/rails5_upgrade
Rails 5.x support (Dropped Rails 4.2 support)
- Loading branch information
Showing
50 changed files
with
407 additions
and
288 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,24 @@ | ||
# See http://help.github.com/ignore-files/ for more about ignoring files. | ||
# | ||
# If you find yourself ignoring temporary files generated by your text editor | ||
# or operating system, you probably want to add a global ignore instead: | ||
# git config --global core.excludesfile ~/.gitignore_global | ||
|
||
# Ignore bundler config | ||
/.bundle | ||
|
||
# Ignore the default SQLite database. | ||
/db/*.sqlite3 | ||
|
||
# Ignore all logfiles and tempfiles. | ||
/log/*.log | ||
/tmp | ||
*.gem | ||
*.rbc | ||
.bundle | ||
.config | ||
.yardoc | ||
.rails_generators~ | ||
|
||
/coverage | ||
|
||
/pkg | ||
|
||
# http://yehudakatz.com/2010/12/16/clarifying-the-roles-of-the-gemspec-and-gemfile/ | ||
/Gemfile.lock | ||
|
||
# Dummy application crap | ||
/spec/dummy/log/*.log | ||
/spec/dummy/tmp | ||
/spec/dummy/db/*.sqlite3 | ||
gemfiles/vendor | ||
Gemfile.lock | ||
InstalledFiles | ||
_yardoc | ||
coverage | ||
doc/ | ||
lib/bundler/man | ||
pkg | ||
rdoc | ||
spec/reports | ||
test/tmp | ||
test/version_tmp | ||
tmp | ||
*.lock | ||
.idea/ | ||
.ruby-version | ||
*.sqlite* | ||
*.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
appraise 'rails-5.0' do | ||
gem 'activerecord', '~> 5.0.0' | ||
gem 'rails-controller-testing' | ||
gem 'rspec-rails', '>= 3.5' | ||
end | ||
|
||
appraise 'rails-5.1' do | ||
gem 'activerecord', '~> 5.1.0' | ||
gem 'rails-controller-testing' | ||
gem 'rspec-rails', '>= 3.5' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,18 @@ | ||
source 'https://rubygems.org' | ||
|
||
group :test do | ||
gem 'appraisal', '>= 2.1' | ||
gem 'capybara', '>= 2.1' | ||
gem 'coveralls', '>= 0.7' | ||
gem 'factory_bot', '>= 4.1' | ||
gem 'rake', '>= 10.0' | ||
gem 'rspec-its', '>= 1.0' | ||
gem 'webmock', '>= 1.9' | ||
end | ||
|
||
# Specify your gem's dependencies in groupify.gemspec | ||
gemspec | ||
|
||
platforms :ruby do | ||
gem 'sqlite3', '>= 1.3' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class CASino::ApplicationRecord < ActiveRecord::Base | ||
self.abstract_class = true | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
class CASino::AuthTokenTicket < ActiveRecord::Base | ||
class CASino::AuthTokenTicket < CASino::ApplicationRecord | ||
include CASino::ModelConcern::Ticket | ||
include CASino::ModelConcern::ConsumableTicket | ||
|
||
self.ticket_prefix = 'ATT'.freeze | ||
|
||
def self.cleanup | ||
delete_all(['created_at < ?', CASino.config.auth_token_ticket[:lifetime].seconds.ago]) | ||
where(['created_at < ?', CASino.config.auth_token_ticket[:lifetime].seconds.ago]).delete_all | ||
end | ||
|
||
def expired? | ||
(Time.now - (self.created_at || Time.now)) > CASino.config.auth_token_ticket[:lifetime].seconds | ||
(Time.now - (created_at || Time.now)) > CASino.config.auth_token_ticket[:lifetime].seconds | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
class CASino::LoginTicket < ActiveRecord::Base | ||
class CASino::LoginTicket < CASino::ApplicationRecord | ||
include CASino::ModelConcern::Ticket | ||
include CASino::ModelConcern::ConsumableTicket | ||
|
||
self.ticket_prefix = 'LT'.freeze | ||
|
||
def self.cleanup | ||
delete_all(['created_at < ?', CASino.config.login_ticket[:lifetime].seconds.ago]) | ||
where(['created_at < ?', CASino.config.login_ticket[:lifetime].seconds.ago]).delete_all | ||
end | ||
|
||
def expired? | ||
(Time.now - (self.created_at || Time.now)) > CASino.config.login_ticket[:lifetime].seconds | ||
(Time.now - (created_at || Time.now)) > CASino.config.login_ticket[:lifetime].seconds | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
|
||
class CASino::TwoFactorAuthenticator < ActiveRecord::Base | ||
class CASino::TwoFactorAuthenticator < CASino::ApplicationRecord | ||
belongs_to :user | ||
|
||
scope :active, -> { where(active: true) } | ||
|
||
def self.cleanup | ||
self.delete_all(['(created_at < ?) AND active = ?', self.lifetime.ago, false]) | ||
where(['(created_at < ?) AND active = ?', lifetime.ago, false]).delete_all | ||
end | ||
|
||
def self.lifetime | ||
CASino.config.two_factor_authenticator[:lifetime_inactive].seconds | ||
end | ||
|
||
def expired? | ||
!self.active? && (Time.now - (self.created_at || Time.now)) > self.class.lifetime | ||
!active? && (Time.now - (created_at || Time.now)) > self.class.lifetime | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.