Railsify dummy app (rails v5.*) (#810)

* add filter_parameter_logging initializer

* models in rails 5.* should be inherited from abstract application record class
This commit is contained in:
Dmytro Stepaniuk 2017-06-20 16:56:53 +03:00 committed by Cliff Braton
parent 727c9101ff
commit 607f03e908
6 changed files with 17 additions and 4 deletions

View File

@ -0,0 +1,3 @@
class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
end

View File

@ -1,3 +1,3 @@
class Post < ActiveRecord::Base
class Post < ApplicationRecord
# attr_accessible :title, :body
end

View File

@ -38,9 +38,6 @@ module Dummy
# Configure the default encoding used in templates for Ruby 1.9.
config.encoding = "utf-8"
# Configure sensitive parameters which will be filtered from the log file.
config.filter_parameters += [:password]
# Enable escaping HTML in JSON.
config.active_support.escape_html_entities_in_json = true

View File

@ -0,0 +1,4 @@
# Be sure to restart your server when you modify this file.
# Configure sensitive parameters which will be filtered from the log file.
Rails.application.config.filter_parameters += [:password]

View File

@ -0,0 +1,7 @@
require 'spec_helper'
describe ApplicationRecord do
it { expect(described_class.superclass).to eq ActiveRecord::Base }
it { expect(described_class.abstract_class).to be_truthy }
end

View File

@ -3,4 +3,6 @@ require 'shared_examples/decoratable'
describe Post do
it_behaves_like "a decoratable model"
it { should be_a ApplicationRecord }
end