-
Notifications
You must be signed in to change notification settings - Fork 57
Open
Description
Thưa anh, lúc chạy framgia-ci thì em được kết quả failed tại rails_best_practice
. Lỗi thông báo là protect_mass_assignment
trong file app/models/application_record.rb
:
Nội dung file như sau ạ:
class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
end
Theo như cách sửa được gợi ý trong trang report của rails_best_practice thì ở đoạn code trên chỉ cần thêm attr_accessible
hoặc attr_protected
cho abstract_class
nhưng vấn đề là:
attr_accessible
vàattr_protected
này đã bị loại bỏ kể từ Rails 4- em có thử thay bằng
attr_reader
/attr_writer
/attr_accessor
nhưng đều không pass đượcrails_best_practice
, chỉ có làm theo gợi ýattr_accessible
hoặcattr_protected
thì mới pass.
Metadata
Metadata
Assignees
Labels
No labels