Skip to content
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

Add Oj to Ruby On Rails #4508

Merged
merged 2 commits into from
Mar 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions frameworks/Ruby/rails/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ gem 'activerecord-import', '0.27.0'
gem 'activerecord', '5.2.2', :require => 'active_record'
gem 'rails', '5.2.2'
gem 'tzinfo-data', '1.2018.7'
gem 'oj', '3.7.9'
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
class ApplicationController < ActionController::Base

before_action :add_header

protected

def add_header
response.set_header('Date', Time.now.httpdate)
end

end
2 changes: 1 addition & 1 deletion frameworks/Ruby/rails/config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ class Application < Rails::Application
# -- all .rb files in that directory are automatically loaded after loading
# the framework and any gems in your application.

config.action_dispatch.default_headers.merge!('Date' => Time.now.httpdate, 'Server' => 'WebServer')
config.action_dispatch.default_headers.merge!('Server' => 'WebServer')
end
end
1 change: 1 addition & 0 deletions frameworks/Ruby/rails/config/initializers/oj.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Oj.optimize_rails