Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
portalmec
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
10
Issues
10
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
PortalMEC
portalmec
Commits
2f074fa9
Commit
2f074fa9
authored
Jul 05, 2016
by
Mateus Rambo Strey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
until step 5
parent
1c03f93f
Changes
54
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
54 changed files
with
283 additions
and
124 deletions
+283
-124
application_job.rb
app/jobs/application_job.rb
+2
-0
application_mailer.rb
app/mailers/application_mailer.rb
+4
-0
application.rb
app/models/application.rb
+1
-1
application_record.rb
app/models/application_record.rb
+3
-0
bookmark.rb
app/models/bookmark.rb
+1
-1
carousel.rb
app/models/carousel.rb
+1
-1
collection.rb
app/models/collection.rb
+1
-1
collection_item.rb
app/models/collection_item.rb
+1
-1
complaint.rb
app/models/complaint.rb
+1
-1
complaint_reason.rb
app/models/complaint_reason.rb
+1
-1
download.rb
app/models/download.rb
+1
-1
follow.rb
app/models/follow.rb
+1
-1
institution.rb
app/models/institution.rb
+1
-1
language.rb
app/models/language.rb
+1
-1
learning_object.rb
app/models/learning_object.rb
+1
-1
attachment.rb
app/models/learning_object/attachment.rb
+1
-1
license.rb
app/models/license.rb
+1
-1
like.rb
app/models/like.rb
+1
-1
mime_type.rb
app/models/mime_type.rb
+1
-1
object_type.rb
app/models/object_type.rb
+1
-1
rate.rb
app/models/rate.rb
+1
-1
rating.rb
app/models/rating.rb
+1
-1
review.rb
app/models/review.rb
+1
-1
review_rating.rb
app/models/review_rating.rb
+1
-1
role.rb
app/models/role.rb
+1
-1
score.rb
app/models/score.rb
+1
-1
score_user_category.rb
app/models/score_user_category.rb
+1
-1
share.rb
app/models/share.rb
+1
-1
tag.rb
app/models/tag.rb
+1
-1
tagging.rb
app/models/tagging.rb
+1
-1
user.rb
app/models/user.rb
+1
-1
user_category.rb
app/models/user_category.rb
+1
-1
view.rb
app/models/view.rb
+1
-1
mailer.html.erb
app/views/layouts/mailer.html.erb
+8
-0
rails
bin/rails
+1
-6
rake
bin/rake
+0
-5
setup
bin/setup
+20
-16
update
bin/update
+29
-0
application.rb
config/application.rb
+7
-2
boot.rb
config/boot.rb
+1
-1
cable.yml
config/cable.yml
+9
-0
database.yml
config/database.yml
+1
-1
environment.rb
config/environment.rb
+1
-1
development.rb
config/environments/development.rb
+29
-6
production.rb
config/environments/production.rb
+38
-36
test.rb
config/environments/test.rb
+4
-1
application_controller_renderer.rb
config/initializers/application_controller_renderer.rb
+6
-0
assets.rb
config/initializers/assets.rb
+11
-0
cookies_serializer.rb
config/initializers/cookies_serializer.rb
+5
-0
new_framework_defaults.rb
config/initializers/new_framework_defaults.rb
+17
-0
wrap_parameters.rb
config/initializers/wrap_parameters.rb
+2
-2
puma.rb
config/puma.rb
+47
-15
routes.rb
config/routes.rb
+2
-2
spring.rb
config/spring.rb
+6
-0
No files found.
app/jobs/application_job.rb
0 → 100644
View file @
2f074fa9
class
ApplicationJob
<
ActiveJob
::
Base
end
app/mailers/application_mailer.rb
0 → 100644
View file @
2f074fa9
class
ApplicationMailer
<
ActionMailer
::
Base
default
from:
'from@example.com'
layout
'mailer'
end
app/models/application.rb
View file @
2f074fa9
class
Application
<
A
ctiveRecord
::
Base
class
Application
<
A
pplicationRecord
belongs_to
:user
validates
:domain
,
presence:
true
,
uniqueness:
true
...
...
app/models/application_record.rb
0 → 100644
View file @
2f074fa9
class
ApplicationRecord
<
ActiveRecord
::
Base
self
.
abstract_class
=
true
end
app/models/bookmark.rb
View file @
2f074fa9
...
...
@@ -10,7 +10,7 @@
# updated_at :datetime not null
#
class
Bookmark
<
A
ctiveRecord
::
Base
class
Bookmark
<
A
pplicationRecord
# Example of Trackable:
# *current_user* create bookmark *bookmarkable*
include
Trackable
...
...
app/models/carousel.rb
View file @
2f074fa9
...
...
@@ -13,7 +13,7 @@
# image_updated_at :datetime
#
class
Carousel
<
A
ctiveRecord
::
Base
class
Carousel
<
A
pplicationRecord
has_attached_file
:image
,
styles:
{
larger:
"600x600>"
,
thumbnail:
"100x100>"
...
...
app/models/collection.rb
View file @
2f074fa9
...
...
@@ -22,7 +22,7 @@
# thumbnail_updated_at :datetime
#
class
Collection
<
A
ctiveRecord
::
Base
class
Collection
<
A
pplicationRecord
include
Reviewable
include
Sociable
include
Followable
...
...
app/models/collection_item.rb
View file @
2f074fa9
...
...
@@ -11,7 +11,7 @@
# updated_at :datetime not null
#
class
CollectionItem
<
A
ctiveRecord
::
Base
class
CollectionItem
<
A
pplicationRecord
# *current_user* add item *collectionable* to *collection*
include
Trackable
...
...
app/models/complaint.rb
View file @
2f074fa9
...
...
@@ -12,7 +12,7 @@
# updated_at :datetime not null
#
class
Complaint
<
A
ctiveRecord
::
Base
class
Complaint
<
A
pplicationRecord
# *current_user* create complaint about *complaint_reason* for *complaintable*
include
Trackable
...
...
app/models/complaint_reason.rb
View file @
2f074fa9
...
...
@@ -8,7 +8,7 @@
# updated_at :datetime not null
#
class
ComplaintReason
<
A
ctiveRecord
::
Base
class
ComplaintReason
<
A
pplicationRecord
# *current_user* create complaint reason
# Only admins can create complaint reasons
include
Trackable
...
...
app/models/download.rb
View file @
2f074fa9
...
...
@@ -10,7 +10,7 @@
# updated_at :datetime not null
#
class
Download
<
A
ctiveRecord
::
Base
class
Download
<
A
pplicationRecord
# *current_user* download *downloadable*
include
Trackable
...
...
app/models/follow.rb
View file @
2f074fa9
...
...
@@ -10,7 +10,7 @@
# updated_at :datetime not null
#
class
Follow
<
A
ctiveRecord
::
Base
class
Follow
<
A
pplicationRecord
# *current_user* follows *followable*
include
Trackable
...
...
app/models/institution.rb
View file @
2f074fa9
...
...
@@ -12,7 +12,7 @@
# updated_at :datetime not null
#
class
Institution
<
A
ctiveRecord
::
Base
class
Institution
<
A
pplicationRecord
include
Tagger
# *current_user* add member for instituion *name*
...
...
app/models/language.rb
View file @
2f074fa9
...
...
@@ -9,7 +9,7 @@
# code :string
#
class
Language
<
A
ctiveRecord
::
Base
class
Language
<
A
pplicationRecord
has_many
:learning_objects
validates_uniqueness_of
:code
...
...
app/models/learning_object.rb
View file @
2f074fa9
...
...
@@ -30,7 +30,7 @@
# attachment_id :integer
#
class
LearningObject
<
A
ctiveRecord
::
Base
class
LearningObject
<
A
pplicationRecord
include
Metadatable
include
Reviewable
include
Sociable
...
...
app/models/learning_object/attachment.rb
View file @
2f074fa9
...
...
@@ -22,7 +22,7 @@
# cache_link :string
#
class
LearningObject
::
Attachment
<
A
ctiveRecord
::
Base
class
LearningObject
::
Attachment
<
A
pplicationRecord
include
::
Thumbnailable
belongs_to
:learning_object
scope
:unknown_mime_type
,
->
()
{
where
(
format:
'Unknown'
)
}
...
...
app/models/license.rb
View file @
2f074fa9
class
License
<
A
ctiveRecord
::
Base
class
License
<
A
pplicationRecord
validates
:name
,
presence:
true
end
app/models/like.rb
View file @
2f074fa9
...
...
@@ -10,7 +10,7 @@
# updated_at :datetime not null
#
class
Like
<
A
ctiveRecord
::
Base
class
Like
<
A
pplicationRecord
# *current_user* likes *likeable*
# *current_user* unlikes *likeable*
include
Trackable
...
...
app/models/mime_type.rb
View file @
2f074fa9
...
...
@@ -7,6 +7,6 @@
# mime_type :string
#
class
MimeType
<
A
ctiveRecord
::
Base
class
MimeType
<
A
pplicationRecord
has_and_belongs_to_many
:object_types
end
app/models/object_type.rb
View file @
2f074fa9
class
ObjectType
<
A
ctiveRecord
::
Base
class
ObjectType
<
A
pplicationRecord
has_many
:learning_objects
has_and_belongs_to_many
:mime_types
...
...
app/models/rate.rb
View file @
2f074fa9
...
...
@@ -8,7 +8,7 @@
# review_id :integer
# created_at :datetime not null
# updated_at :datetime not null
class
Rate
<
A
ctiveRecord
::
Base
class
Rate
<
A
pplicationRecord
# *current_user* rate a review *review*
include
Trackable
...
...
app/models/rating.rb
View file @
2f074fa9
...
...
@@ -9,7 +9,7 @@
# description :string
#
class
Rating
<
A
ctiveRecord
::
Base
class
Rating
<
A
pplicationRecord
has_many
:review_ratings
has_many
:reviews
,
through: :review_ratings
end
app/models/review.rb
View file @
2f074fa9
...
...
@@ -15,7 +15,7 @@
# rates_count :integer default("0")
#
class
Review
<
A
ctiveRecord
::
Base
class
Review
<
A
pplicationRecord
# *current_user* review *reviewable*
include
Trackable
...
...
app/models/review_rating.rb
View file @
2f074fa9
...
...
@@ -10,7 +10,7 @@
# updated_at :datetime not null
#
class
ReviewRating
<
A
ctiveRecord
::
Base
class
ReviewRating
<
A
pplicationRecord
belongs_to
:review
belongs_to
:rating
...
...
app/models/role.rb
View file @
2f074fa9
...
...
@@ -9,7 +9,7 @@
# updated_at :datetime not null
#
class
Role
<
A
ctiveRecord
::
Base
class
Role
<
A
pplicationRecord
has_and_belongs_to_many
:users
validates_presence_of
:name
...
...
app/models/score.rb
View file @
2f074fa9
...
...
@@ -12,7 +12,7 @@
# score_type :string default("{}"), is an Array
#
class
Score
<
A
ctiveRecord
::
Base
class
Score
<
A
pplicationRecord
has_many
:score_user_categories
has_many
:user_categories
,
through: :score_user_categories
...
...
app/models/score_user_category.rb
View file @
2f074fa9
...
...
@@ -10,7 +10,7 @@
# updated_at :datetime not null
#
class
ScoreUserCategory
<
A
ctiveRecord
::
Base
class
ScoreUserCategory
<
A
pplicationRecord
belongs_to
:score
belongs_to
:user_category
...
...
app/models/share.rb
View file @
2f074fa9
...
...
@@ -10,7 +10,7 @@
# updated_at :datetime not null
#
class
Share
<
A
ctiveRecord
::
Base
class
Share
<
A
pplicationRecord
# *current_user* shares *shareable*
include
Trackable
...
...
app/models/tag.rb
View file @
2f074fa9
class
Tag
<
A
ctiveRecord
::
Base
class
Tag
<
A
pplicationRecord
has_many
:taggings
validates_presence_of
:name
end
app/models/tagging.rb
View file @
2f074fa9
class
Tagging
<
A
ctiveRecord
::
Base
class
Tagging
<
A
pplicationRecord
# *current_user* tag *taggable* with *tag*
include
Trackable
...
...
app/models/user.rb
View file @
2f074fa9
...
...
@@ -33,7 +33,7 @@
# follows_count :integer default("0")
#
class
User
<
A
ctiveRecord
::
Base
class
User
<
A
pplicationRecord
include
Followable
include
Reputationable
include
Tagger
...
...
app/models/user_category.rb
View file @
2f074fa9
...
...
@@ -9,7 +9,7 @@
# updated_at :datetime not null
#
class
UserCategory
<
A
ctiveRecord
::
Base
class
UserCategory
<
A
pplicationRecord
has_many
:score_user_categories
has_many
:scores
,
through: :score_user_categories
...
...
app/models/view.rb
View file @
2f074fa9
...
...
@@ -10,7 +10,7 @@
# updated_at :datetime not null
#
class
View
<
A
ctiveRecord
::
Base
class
View
<
A
pplicationRecord
# *current_user* views *viewable*
include
Trackable
...
...
app/views/layouts/mailer.html.erb
0 → 100644
View file @
2f074fa9
<!DOCTYPE html>
<html>
<head>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
/>
<style>
/* Email styles need to be inline */
</style>
</head>
<body>
<%=
yield
%>
</body>
</html>
bin/rails
View file @
2f074fa9
#!/usr/bin/env ruby
begin
load
File
.
expand_path
(
'../spring'
,
__FILE__
)
rescue
LoadError
=>
e
raise
unless
e
.
message
.
include?
(
'spring'
)
end
APP_PATH
=
File
.
expand_path
(
'../../config/application'
,
__FILE__
)
APP_PATH
=
File
.
expand_path
(
'../config/application'
,
__dir__
)
require_relative
'../config/boot'
require
'rails/commands'
bin/rake
View file @
2f074fa9
#!/usr/bin/env ruby
begin
load
File
.
expand_path
(
'../spring'
,
__FILE__
)
rescue
LoadError
=>
e
raise
unless
e
.
message
.
include?
(
'spring'
)
end
require_relative
'../config/boot'
require
'rake'
Rake
.
application
.
run
bin/setup
View file @
2f074fa9
#!/usr/bin/env ruby
require
'pathname'
require
'fileutils'
include
FileUtils
# path to your application root.
APP_ROOT
=
Pathname
.
new
File
.
expand_path
(
'../../'
,
__FILE__
)
APP_ROOT
=
Pathname
.
new
File
.
expand_path
(
'../../'
,
__FILE__
)
Dir
.
chdir
APP_ROOT
do
def
system!
(
*
args
)
system
(
*
args
)
||
abort
(
"
\n
== Command
#{
args
}
failed =="
)
end
chdir
APP_ROOT
do
# This script is a starting point to setup your application.
# Add necessary setup steps to this file
:
# Add necessary setup steps to this file
.
puts
"== Installing dependencies =="
system
"gem install bundler --conservative"
system
"bundle check || bundle install --jobs $(nproc)"
puts
'== Installing dependencies =='
system
!
'gem install bundler --conservative'
system
(
'bundle check'
)
||
system
!
(
'bundle install'
)
puts
"
\n
== Checks database config file =="
unless
File
.
exist?
(
"config/database.yml"
)
puts
"
\n
You need create config/database.yml. Please follow our README"
exit
end
# puts "\n== Copying sample files =="
# unless File.exist?('config/database.yml')
# cp 'config/database.yml.sample', 'config/database.yml'
# end
puts
"
\n
== Preparing database
s, importing data and setup PortalMEC
=="
system
"bundle exec rake portalmec:setup"
puts
"
\n
== Preparing database =="
system
!
'bundle exec rake portalmec:setup'
puts
"
\n
== Removing old logs and tempfiles =="
system
"rm -f log/*"
system
"rm -rf tmp/cache"
system
!
'bin/rails log:clear tmp:clear'
puts
"
\n
== Restarting application server =="
system
"touch tmp/restart.txt"
system
!
'bin/rails restart'
end
bin/update
0 → 100755
View file @
2f074fa9
#!/usr/bin/env ruby
require
'pathname'
require
'fileutils'
include
FileUtils
# path to your application root.
APP_ROOT
=
Pathname
.
new
File
.
expand_path
(
'../../'
,
__FILE__
)
def
system!
(
*
args
)
system
(
*
args
)
||
abort
(
"
\n
== Command
#{
args
}
failed =="
)
end
chdir
APP_ROOT
do
# This script is a way to update your development environment automatically.
# Add necessary update steps to this file.
puts
'== Installing dependencies =='
system
!
'gem install bundler --conservative'
system
(
'bundle check'
)
||
system
!
(
'bundle install'
)
puts
"
\n
== Updating database =="
system
!
'bin/rails db:migrate'
puts
"
\n
== Removing old logs and tempfiles =="
system
!
'bin/rails log:clear tmp:clear'
puts
"
\n
== Restarting application server =="
system
!
'bin/rails restart'
end
config/application.rb
View file @
2f074fa9
require
File
.
expand_path
(
'../boot'
,
__FILE__
)
require
_relative
'boot'
# require 'rails/all'
require
'rails'
require
'active_model/railtie'
# require 'active_job/railtie'
require
'active_record/railtie'
require
'action_controller/railtie'
require
'action_mailer/railtie'
require
'action_view/railtie'
# require 'action_cable/engine'
# require 'sprockets/railtie'
require
'rails/test_unit/railtie'
require
'rack/redis_throttle'
...
...
config/boot.rb
View file @
2f074fa9
ENV
[
'BUNDLE_GEMFILE'
]
||=
File
.
expand_path
(
'../
../Gemfile'
,
__FILE
__
)
ENV
[
'BUNDLE_GEMFILE'
]
||=
File
.
expand_path
(
'../
Gemfile'
,
__dir
__
)
require
'bundler/setup'
# Set up gems listed in the Gemfile.
config/cable.yml
0 → 100644
View file @
2f074fa9
development
:
adapter
:
async
test
:
adapter
:
async
production
:
adapter
:
redis
url
:
redis://localhost:6379/1
config/database.yml
View file @
2f074fa9
...
...
@@ -15,7 +15,7 @@ test:
database
:
portalmec_test
username
:
portalmec
password
:
123mudar
host
:
postgres
#
host: postgres
production
:
<<
:
*defaults
...
...
config/environment.rb
View file @
2f074fa9
# Load the Rails application.
require
File
.
expand_path
(
'../application'
,
__FILE__
)
require
_relative
'application'
# Initialize the Rails application.
Rails
.
application
.
initialize!
config/environments/development.rb
View file @
2f074fa9
...
...
@@ -21,32 +21,55 @@ Rails.application.configure do
# Do not eager load code on boot.
config
.
eager_load
=
false
# Show full error reports and disable caching.
config
.
consider_all_requests_local
=
true
config
.
action_controller
.
perform_caching
=
false
# Show full error reports.
config
.
consider_all_requests_local
=
true
# Enable/disable caching. By default caching is disabled.
if
Rails
.
root
.
join
(
'tmp/caching-dev.txt'
).
exist?
config
.
action_controller
.
perform_caching
=
true
config
.
cache_store
=
:memory_store
config
.
public_file_server
.
headers
=
{
'Cache-Control'
=>
'public, max-age=172800'
}
else
config
.
action_controller
.
perform_caching
=
false
config
.
cache_store
=
:null_store
end
# Don't care if the mailer can't send.
config
.
action_mailer
.
raise_delivery_errors
=
false
config
.
action_mailer
.
perform_caching
=
false
# Print deprecation notices to the Rails logger.
config
.
active_support
.
deprecation
=
:log
# Raise an error on page load if there are pending migrations.
config
.
active_record
.
migration_error
=
:page_load
# Raises error for missing translations
# config.action_view.raise_on_missing_translations = true
# Use an evented file watcher to asynchronously detect changes in source code,
# routes, locales, etc. This feature depends on the listen gem.
# config.file_watcher = ActiveSupport::EventedFileUpdateChecker
# Debug mode disables concatenation and preprocessing of assets.
# This option may cause significant delays in view rendering with a large
# number of complex assets.
config
.
assets
.
debug
=
true
#
config.assets.debug = true
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
# yet still be able to expire them through the digest params.
config
.
assets
.
digest
=
true
#
config.assets.digest = true
# Adds additional error checking when serving assets at runtime.
# Checks for improperly declared sprockets dependencies.
# Raises helpful error messages.
config
.
assets
.
raise_runtime_errors
=
true
#
config.assets.raise_runtime_errors = true
# Raises error for missing translations
# config.action_view.raise_on_missing_translations = true
...
...
config/environments/production.rb
View file @
2f074fa9
...
...
@@ -14,33 +14,23 @@ Rails.application.configure do
config
.
consider_all_requests_local
=
false
config
.
action_controller
.
perform_caching
=
true
# Enable Rack::Cache to put a simple HTTP cache in front of your application
# Add `rack-cache` to your Gemfile before enabling this.
# For large-scale production use, consider using a caching reverse proxy like
# NGINX, varnish or squid.
# config.action_dispatch.rack_cache = true
# Disable serving static files from the `/public` folder by default since
# Apache or NGINX already handles this.
config
.
serve_static_files
=
ENV
[
'RAILS_SERVE_STATIC_FILES'
].
present?
# Compress JavaScripts and CSS.
config
.
assets
.
js_compressor
=
:uglifier
# config.assets.css_compressor = :sass
# Do not fallback to assets pipeline if a precompiled asset is missed.
config
.
assets
.
compile
=
true
config
.
public_file_server
.
enabled
=
ENV
[
'RAILS_SERVE_STATIC_FILES'
].
present?
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
# yet still be able to expire them through the digest params.
config
.
assets
.
digest
=
true
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
# config.action_controller.asset_host = 'http://assets.example.com'
# Specifies the header that your server uses for sending files.
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
# Mount Action Cable outside main process or domain
# config.action_cable.mount_path = nil
# config.action_cable.url = 'wss://example.com/cable'
# config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
# config.force_ssl = true
...
...
@@ -49,32 +39,19 @@ Rails.application.configure do
config
.
log_level
=
:debug
# Prepend all log lines with the following tags.
# config.log_tags = [ :subdomain, :uuid ]
# Use a different logger for distributed setups.
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
config
.
log_tags
=
[
:request_id
]
# Use a different cache store in production.
# config.cache_store = :mem_cache_store
# memcached server specified in ENV["MEMCACHE_SERVERS"]
config
.
cache_store
=
:dalli_store
,
nil
,
{
:namespace
=>
'portalmec'
,
:expires_in
=>
1
.
day
,
:compress
=>
true
,
:pool_size
=>
5
}
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
# config.action_controller.asset_host = 'http://assets.example.com'
# Use a real queuing backend for Active Job (and separate queues per environment)
# config.active_job.queue_adapter = :resque
# config.active_job.queue_name_prefix = "portalmec_#{Rails.env}"
config
.
action_mailer
.
perform_caching
=
false
# Ignore bad email addresses and do not raise email delivery errors.
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
# config.action_mailer.raise_delivery_errors = false
config
.
action_mailer
.
default_url_options
=
{
host:
ENV
[
'ACTION_MAILER_HOST'
]
}
config
.
action_mailer
.
delivery_method
=
:smtp
config
.
action_mailer
.
smtp_settings
=
{
address:
ENV
[
'SMTP_ADDRESS'
],
port:
ENV
[
'SMTP_PORT'
],
openssl_verify_mode:
'none'
,
domain:
ENV
[
'ACTION_MAILER_HOST'
]
}
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation cannot be found).
...
...
@@ -86,6 +63,31 @@ Rails.application.configure do
# Use default logging formatter so that PID and timestamp are not suppressed.
config
.
log_formatter
=
::
Logger
::
Formatter
.
new
# Use a different logger for distributed setups.
# require 'syslog/logger'
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
if
ENV
[
"RAILS_LOG_TO_STDOUT"
].
present?
logger
=
ActiveSupport
::
Logger
.
new
(
STDOUT
)
logger
.
formatter
=
config
.
log_formatter
config
.
logger
=
ActiveSupport
::
TaggedLogging
.
new
(
logger
)
end
# Do not dump schema after migrations.
config
.
active_record
.
dump_schema_after_migration
=
false
config
.
cache_store
=
:dalli_store
,
nil
,
{
:namespace
=>
'portalmec'
,
:expires_in
=>
1
.
day
,
:compress
=>
true
,
:pool_size
=>
5
}
# Ignore bad email addresses and do not raise email delivery errors.
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
# config.action_mailer.raise_delivery_errors = false
config
.
action_mailer
.
default_url_options
=
{
host:
ENV
[
'ACTION_MAILER_HOST'
]
}
config
.
action_mailer
.
delivery_method
=
:smtp
config
.
action_mailer
.
smtp_settings
=
{
address:
ENV
[
'SMTP_ADDRESS'
],
port:
ENV
[
'SMTP_PORT'
],
openssl_verify_mode:
'none'
,
domain:
ENV
[
'ACTION_MAILER_HOST'
]
}
end
config/environments/test.rb
View file @
2f074fa9
...
...
@@ -14,7 +14,10 @@ Rails.application.configure do
# Configure static file server for tests with Cache-Control for performance.
config
.
serve_static_files
=
true
config
.
static_cache_control
=
'public, max-age=3600'
config
.
public_file_server
.
headers
=
{
'Cache-Control'
=>
'public, max-age=3600'
}
# Show full error reports and disable caching.
config
.
consider_all_requests_local
=
true
...
...
config/initializers/application_controller_renderer.rb
0 → 100644
View file @
2f074fa9
# Be sure to restart your server when you modify this file.
# ApplicationController.renderer.defaults.merge!(
# http_host: 'example.org',
# https: false
# )
config/initializers/assets.rb
0 → 100644
View file @
2f074fa9
# Be sure to restart your server when you modify this file.
# Version of your assets, change this if you want to expire all your assets.
# Rails.application.config.assets.version = '1.0'
# Add additional assets to the asset load path
# Rails.application.config.assets.paths << Emoji.images_path
# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
# Rails.application.config.assets.precompile += %w( search.js )
config/initializers/cookies_serializer.rb
0 → 100644
View file @
2f074fa9
# Be sure to restart your server when you modify this file.
# Specify a serializer for the signed and encrypted cookie jars.
# Valid options are :json, :marshal, and :hybrid.
Rails
.
application
.
config
.
action_dispatch
.
cookies_serializer
=
:marshal
config/initializers/new_framework_defaults.rb
0 → 100644
View file @
2f074fa9
# Be sure to restart your server when you modify this file.
#
# This file contains migration options to ease your Rails 5.0 upgrade.
#
# Once upgraded flip defaults one by one to migrate to the new default.
#
# Read the Rails 5.0 release notes for more info on each option.
# Make Ruby 2.4 preserve the timezone of the receiver when calling `to_time`.
# Previous versions had false.
ActiveSupport
.
to_time_preserves_timezone
=
false
# Require `belongs_to` associations by default. Previous versions had false.
Rails
.
application
.
config
.
active_record
.
belongs_to_required_by_default
=
false
# Do not halt callback chains when a callback returns false. Previous versions had true.
ActiveSupport
.
halt_callback_chains_on_return_false
=
true
config/initializers/wrap_parameters.rb
View file @
2f074fa9
...
...
@@ -5,10 +5,10 @@
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
ActiveSupport
.
on_load
(
:action_controller
)
do
wrap_parameters
format:
[
:json
]
if
respond_to?
(
:wrap_parameters
)
wrap_parameters
format:
[
:json
]
end
# To enable root element in JSON for ActiveRecord objects.
# ActiveSupport.on_load(:active_record) do
# self.include_root_in_json = true
#
self.include_root_in_json = true
# end
config/puma.rb
View file @
2f074fa9
# Change to match your CPU core count
workers
2
# Puma can serve each request in a thread from an internal thread pool.
# The `threads` method setting takes two numbers a minimum and maximum.
# Any libraries that use thread pools should be configured to match
# the maximum value specified for Puma. Default is set to 5 threads for minimum
# and maximum, this matches the default thread size of Active Record.
#
threads_count
=
ENV
.
fetch
(
'RAILS_MAX_THREADS'
)
{
5
}.
to_i
threads
threads_count
,
threads_count
# Min and Max threads per worker
threads
1
,
6
# Specifies the `port` that Puma will listen on to receive requests, default is 3000.
#
port
ENV
.
fetch
(
'PORT'
)
{
3000
}
app_dir
=
File
.
expand_path
(
"../.."
,
__FILE__
)
shared_dir
=
"
#{
app_dir
}
/shared"
# Specifies the `environment` that Puma will run in.
#
environment
ENV
.
fetch
(
'RAILS_ENV'
)
{
'development'
}
# Specifies the number of `workers` to boot in clustered mode.
# Workers are forked webserver processes. If using threads and workers together
# the concurrency of the application would be max `threads` * `workers`.
# Workers do not work on JRuby or Windows (both of which do not support
# processes).
#
workers
ENV
.
fetch
(
'WEB_CONCURRENCY'
)
{
2
}
# Use the `preload_app!` method when specifying a `workers` number.
# This directive tells Puma to first boot the application and load code
# before forking the application. This takes advantage of Copy On Write
# process behavior so workers use less memory. If you use this option
# you need to make sure to reconnect any threads in the `on_worker_boot`
# block.
#