-
Notifications
You must be signed in to change notification settings - Fork 0
Add AR mixins to simple oauth2 #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
7112cb6 to
c78025d
Compare
c78025d to
3e17f18
Compare
spec/support/db/schema.rb
Outdated
| # | ||
| # It's strongly recommended that you check this file into your version control system. | ||
|
|
||
| ActiveRecord::Schema.define(version: 20_180_203_210_135) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Block has too many lines. [46/25]
| @@ -0,0 +1,47 @@ | |||
| class CreateSchema < ActiveRecord::Migration[5.1] | |||
| def change | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assignment Branch Condition size for change is too high. [28/15]
Method has too many lines. [32/15]
| @@ -0,0 +1,41 @@ | |||
| require 'spec_helper' | |||
|
|
|||
| describe User do | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Block has too many lines. [27/25]
| @@ -0,0 +1,77 @@ | |||
| require 'spec_helper' | |||
|
|
|||
| describe Client do | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Block has too many lines. [54/25]
| @@ -0,0 +1,137 @@ | |||
| require 'spec_helper' | |||
|
|
|||
| describe AccessToken do | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Block has too many lines. [94/25]
| @@ -0,0 +1,74 @@ | |||
| require 'spec_helper' | |||
|
|
|||
| describe AccessGrant do | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Block has too many lines. [51/25]
| # | ||
| def self.oauth_authenticate(_client, username, password) | ||
| user = where(username: username.to_s).first | ||
| user if user && user.encrypted_password == password |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use safe navigation (&.) instead of checking if an object exists before calling the method.
67158bb to
8753810
Compare
| t.datetime "created_at", null: false | ||
| t.datetime "updated_at", null: false | ||
| end | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra empty line detected at block body end.
| t.string "username", null: false | ||
| t.string "encrypted_password", null: false | ||
| t.datetime "created_at", null: false | ||
| t.datetime "updated_at", null: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer single-quoted strings when you don't need string interpolation or special symbols.
| create_table "users", force: :cascade do |t| | ||
| t.string "username", null: false | ||
| t.string "encrypted_password", null: false | ||
| t.datetime "created_at", null: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
|
||
| create_table "users", force: :cascade do |t| | ||
| t.string "username", null: false | ||
| t.string "encrypted_password", null: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer single-quoted strings when you don't need string interpolation or special symbols.
| end | ||
|
|
||
| create_table "users", force: :cascade do |t| | ||
| t.string "username", null: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer single-quoted strings when you don't need string interpolation or special symbols.
db/schema.rb
Outdated
| t.datetime "created_at", null: false | ||
| t.datetime "updated_at", null: false | ||
| t.index ["key"], name: "index_applications_on_key" | ||
| t.index ["secret"], name: "index_applications_on_secret" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer single-quoted strings when you don't need string interpolation or special symbols.
db/schema.rb
Outdated
| t.string "secret", null: false | ||
| t.datetime "created_at", null: false | ||
| t.datetime "updated_at", null: false | ||
| t.index ["key"], name: "index_applications_on_key" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer single-quoted strings when you don't need string interpolation or special symbols.
| t.string "key", null: false | ||
| t.string "secret", null: false | ||
| t.datetime "created_at", null: false | ||
| t.datetime "updated_at", null: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer single-quoted strings when you don't need string interpolation or special symbols.
| t.string "redirect_uri", null: false | ||
| t.string "key", null: false | ||
| t.string "secret", null: false | ||
| t.datetime "created_at", null: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer single-quoted strings when you don't need string interpolation or special symbols.
| t.string "name", null: false | ||
| t.string "redirect_uri", null: false | ||
| t.string "key", null: false | ||
| t.string "secret", null: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer single-quoted strings when you don't need string interpolation or special symbols.
8753810 to
f5aeb4e
Compare
| create_table "applications", force: :cascade do |t| | ||
| t.string "name", null: false | ||
| t.string "redirect_uri", null: false | ||
| t.string "key", null: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer single-quoted strings when you don't need string interpolation or special symbols.
c7e4e1d to
a9bd685
Compare
| t.datetime "created_at", null: false | ||
| t.datetime "updated_at", null: false | ||
| end | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra empty line detected at block body end.
db/schema.rb
Outdated
| t.string "username", null: false | ||
| t.string "encrypted_password", null: false | ||
| t.datetime "created_at", null: false | ||
| t.datetime "updated_at", null: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer single-quoted strings when you don't need string interpolation or special symbols.
db/schema.rb
Outdated
| end | ||
|
|
||
| add_index "clients", ["key"], name: "index_clients_on_key" | ||
| add_index "clients", ["secret"], name: "index_clients_on_secret" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer single-quoted strings when you don't need string interpolation or special symbols.
db/schema.rb
Outdated
| t.datetime "updated_at", null: false | ||
| end | ||
|
|
||
| add_index "clients", ["key"], name: "index_clients_on_key" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer single-quoted strings when you don't need string interpolation or special symbols.
320da39 to
6656fb3
Compare
| @@ -0,0 +1,47 @@ | |||
| class CreateSchema < ActiveRecord::Migration[5.0] | |||
| def change | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assignment Branch Condition size for change is too high. [28/15]
Method has too many lines. [32/15]
| @@ -0,0 +1,47 @@ | |||
| class CreateSchema < ActiveRecord::Migration[5.0] | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing top-level class documentation comment.
413edd6 to
6b893e0
Compare
6b893e0 to
80d9aaa
Compare
No description provided.