2016-11-11 2 views
1

4.0으로 업그레이드하고 ruby-2.2.5를 사용하고 있습니다. 필자는 >> exec exec rake를 실행할 때 나타나는 몇 가지 사용 중단 경고 (Debrecation Warnings)로갑니다. 경고의더 이상 사용되지 않음 경고 대용량 레일 Rails 4.0에 대해

하나는 :

DEPRECATION WARNING: Model based mass assignment security has been extracted out of Rails into a gem. 
Please use the new recommended protection model for params or add `protected_attributes` to your Gemfile to use the old one. 

To disable this message remove the `whitelist_attributes` option from your `config/application.rb` file 
and any `mass_assignment_sanitizer` options from your `config/environments/*.rb` files. 

See http://guides.rubyonrails.org/security.html#mass-assignment for more information. 

난에 대해 어떻게이 이해하고 내가 찾고 'attr_accessible'제거 내 모든 모델을 통해 갔다. 내 모든 컨트롤러를 통과하고 내 '생성'및 '업데이트'작업에서 호출하는 strong_params에 대한 메소드를 추가했습니다. 'whitelist_attributes'또는 'mass_assignment_sanitizer'옵션을 사용하지 않습니다. 그리고 모든 사양 테스트가 끝나고 있습니다.

내 질문은,이 경고는 단지 표준 출력이 될 것인가 아니면 내가보기 싫은 무언가를 보는 레일로부터 오는 것인가? 아이디어?

많은 감사

+0

내가 거기에 생각 환경 파일 중 하나에 대한 설정, 또는 여전히 application.rb에 레일이 불만을 제기하는 경우 –

+0

# 활성 레코드 모델의 대량 할당 보호 예외 발생 >> config.active_record.mass_assignment_sanitizer = : strict –

+0

>> 환경 설정/테스트 .rb의 config.active_record.mass_assignment_sanitizer = : strict 및 developmentement.rb. 주석 처리하면 사용 중단 경고가 제거됩니다. J-dexx 감사합니다. 나는 거기를 보려고 생각하지 않았을 것입니다 - 분명히. –

답변

0

당신의 Gemfile에 gem 'protected_attributes', '~>1.1.3'을 추가하는 시도는, 어떤 사람들은 보석이 레일 4 필요가 있다고하지만이 중단 문제를 해결, 최선의 해결책 인 경우 I 확실하지 : https://github.com/rails/protected_attributes

관련 문제