-
Notifications
You must be signed in to change notification settings - Fork 3
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
fix eduroam accounting and auth #10
base: master
Are you sure you want to change the base?
fix eduroam accounting and auth #10
Conversation
@@ -62,6 +62,6 @@ group :development do | |||
gem 'web-console', '>= 3.3.0' | |||
# Spring speeds up development by keeping your application running in the background. | |||
# Read more: https://github.com/rails/spring | |||
gem 'spring' | |||
gem 'spring-watcher-listen', '~> 2.0.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.
@dmitry-sinina why did you remove spring? Have you encountered some issues with it?
has_many :email_redirects, class_name: 'Email::Redirect', foreign_key: :domain_id, inverse_of: :domain, dependent: :restrict_with_error | ||
|
||
validates :fqdn, presence: true | ||
validates :fqdn, uniqueness: true |
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.
@dmitry-sinina you can write it in a single line:
validates :fqdn, presence: true, uniqueness: true
class Domain < ApplicationRecord | ||
self.table_name = 'domains' | ||
|
||
has_many :email_redirects, class_name: 'Email::Redirect', foreign_key: :domain_id, inverse_of: :domain, dependent: :restrict_with_error |
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.
@dmitry-sinina you can omit foreign_key
key cause it will be equal to :domain_id
by default according to Rails convention
class Email::Redirect < ApplicationRecord | ||
self.table_name = 'email_redirects' | ||
|
||
belongs_to :domain, class_name: 'Domain', foreign_key: :domain_id, inverse_of: :email_redirects |
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.
@dmitry-sinina you can omit foreign_key
key cause it will be equal to :domain_id
by default according to Rails convention
validates :username, uniqueness: { scope: :domain_id } | ||
|
||
def display_name | ||
rewrited_destination.to_s |
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.
@dmitry-sinina you don't need to add .to_s
explicitly because you've already have a valiation that value can't be nil
validates :fqdn, uniqueness: true | ||
|
||
def display_name | ||
fqdn.to_s |
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.
@dmitry-sinina you don't need to add .to_s
explicitly because you've already have a valiation that value can't be nil
@@ -26,8 +26,9 @@ def authorize! | |||
|
|||
def authorization_data_for(record) | |||
{ | |||
'User-Name': record.login, | |||
'Cleartext-Password': record.password | |||
# 'User-Name': record.login, |
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.
why we don't need to provide login in response anymore?
No description provided.