1
0
Fork 0
mirror of https://github.com/drapergem/draper synced 2023-03-27 23:21:17 -04:00

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 # attr_accessible :title, :body
end end

View file

@ -38,9 +38,6 @@ module Dummy
# Configure the default encoding used in templates for Ruby 1.9. # Configure the default encoding used in templates for Ruby 1.9.
config.encoding = "utf-8" config.encoding = "utf-8"
# Configure sensitive parameters which will be filtered from the log file.
config.filter_parameters += [:password]
# Enable escaping HTML in JSON. # Enable escaping HTML in JSON.
config.active_support.escape_html_entities_in_json = true 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 describe Post do
it_behaves_like "a decoratable model" it_behaves_like "a decoratable model"
it { should be_a ApplicationRecord }
end end