-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
KBP-179 #time 90m - Edit rubocop warnings
- Loading branch information
hamdibayhan
committed
Dec 15, 2017
1 parent
346a510
commit 2e2fdb8
Showing
18 changed files
with
74 additions
and
48 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
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
1 change: 0 additions & 1 deletion
1
templates/app_files/app/controllers/hq/application_controller.rb
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,19 +1,23 @@ | ||
# frozen_string_literal: true | ||
|
||
module ApplicationHelper | ||
def get_active_users | ||
User.active.map{|c| ["#{c.email} - #{c.full_name}", c.id] } | ||
def devise_model_map(model_name) | ||
model_name.map { |c| ["#{c.email} - #{c.full_name}", c.id] } | ||
end | ||
|
||
def get_users | ||
User.all.map{|c| ["#{c.email} - #{c.full_name}", c.id] } | ||
def active_users | ||
devise_model_map(User.active) | ||
end | ||
|
||
def get_admins | ||
Admin.all.map{|c| ["#{c.email} - #{c.full_name}", c.id] } | ||
def users | ||
devise_model_map(User.all) | ||
end | ||
|
||
def get_audit_users | ||
def admins | ||
devise_model_map(Admin.all) | ||
end | ||
|
||
def audit_users | ||
[[t('activerecord.models.admin'), 'Admin'], [t('activerecord.models.user'), 'User']] | ||
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,3 +1,4 @@ | ||
|
||
# jquery gems | ||
gem 'jquery-rails', '~> 4.3', '>= 4.3.1' | ||
gem 'jquery-ui-rails', '~> 6.0', '>= 6.0.1' |
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,2 +1,2 @@ | ||
|
||
before_action :authenticate_admin! | ||
before_action :authenticate_admin! |
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,11 +1,13 @@ | ||
|
||
|
||
def configure_devise_permitted_parameters | ||
sign_up_attributes = %i[email password password_confirmation name surname] | ||
sign_in_attributes = %i[email password password_confirmation current_password] | ||
if resource_class == User | ||
devise_parameter_sanitizer.permit(:sign_up, keys: [:email, :password, :password_confirmation, :name, :surname]) | ||
devise_parameter_sanitizer.permit(:sign_in, keys: [:email, :password, :password_confirmation, :current_password]) | ||
devise_parameter_sanitizer.permit(:sign_up, keys: sign_up_attributes) | ||
devise_parameter_sanitizer.permit(:sign_in, keys: sign_in_attributes) | ||
elsif resource_class == Admin | ||
devise_parameter_sanitizer.permit(:sign_up, keys: [:email, :password, :password_confirmation, :name, :surname]) | ||
devise_parameter_sanitizer.permit(:sign_in, keys: [:email, :password, :password_confirmation, :current_password]) | ||
devise_parameter_sanitizer.permit(:sign_up, keys: sign_up_attributes) | ||
devise_parameter_sanitizer.permit(:sign_in, keys: sign_in_attributes) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,4 @@ | |
|
||
def page_not_found | ||
render template: 'errors/not_found', status: 404 | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
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,2 @@ | ||
|
||
match '*unmatched_route', to: 'application#page_not_found', via: :all unless Rails.env.development? |
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,10 +1,10 @@ | ||
config.action_mailer.delivery_method = :smtp | ||
config.action_mailer.raise_delivery_errors = false | ||
config.action_mailer.smtp_settings = { | ||
address: Settings.smtp.address, | ||
port: Settings.smtp.port, | ||
enable_starttls_auto: Settings.smtp.enable_starttls_auto, | ||
user_name: Settings.smtp.user_name, | ||
password: Settings.smtp.password, | ||
authentication: Settings.smtp.authentication | ||
address: Settings.smtp.address, | ||
port: Settings.smtp.port, | ||
enable_starttls_auto: Settings.smtp.enable_starttls_auto, | ||
user_name: Settings.smtp.user_name, | ||
password: Settings.smtp.password, | ||
authentication: Settings.smtp.authentication | ||
} |
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,4 +1,4 @@ | ||
|
||
# Easy file attachment management for ActiveRecord. Amazon's S3 storage adapter. | ||
gem "paperclip", "~> 5.0.0" | ||
gem 'aws-sdk', '~> 2.3.0' | ||
gem 'aws-sdk', '~> 2.3.0' | ||
gem 'paperclip', '~> 5.0.0' |
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,2 +1,3 @@ | ||
|
||
#Wrap your objects with a helper to easily show them | ||
gem 'show_for', '~> 0.6.0' |
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,7 +1,7 @@ | ||
|
||
|
||
# ========== Sidekiq ========== | ||
Sidekiq::Web.use Rack::Auth::Basic do |username, password| | ||
username == 'sidekiq' && password == 'sidekiq' | ||
end if Rails.env.production? | ||
mount Sidekiq::Web, at: '/sidekiq' | ||
if Rails.env.production? | ||
Sidekiq::Web.use Rack::Auth::Basic do |username, password| | ||
username == 'sidekiq' && password == 'sidekiq' | ||
end | ||
end |