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:
parent
727c9101ff
commit
607f03e908
|
@ -0,0 +1,3 @@
|
|||
class ApplicationRecord < ActiveRecord::Base
|
||||
self.abstract_class = true
|
||||
end
|
|
@ -1,3 +1,3 @@
|
|||
class Post < ActiveRecord::Base
|
||||
class Post < ApplicationRecord
|
||||
# attr_accessible :title, :body
|
||||
end
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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]
|
|
@ -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
|
|
@ -3,4 +3,6 @@ require 'shared_examples/decoratable'
|
|||
|
||||
describe Post do
|
||||
it_behaves_like "a decoratable model"
|
||||
|
||||
it { should be_a ApplicationRecord }
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue