{"action":"closed","issue":{"url":"https://api.github.com/repos/raoul2000/yii2-workflow/issues/21","repository_url":"https://api.github.com/repos/raoul2000/yii2-workflow","labels_url":"https://api.github.com/repos/raoul2000/yii2-workflow/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/raoul2000/yii2-workflow/issues/21/comments","events_url":"https://api.github.com/repos/raoul2000/yii2-workflow/issues/21/events","html_url":"https://github.com/raoul2000/yii2-workflow/issues/21","id":159827917,"number":21,"title":"Unsafe attributes","user":{"login":"Faryshta","id":2029247,"avatar_url":"https://avatars.githubusercontent.com/u/2029247?v=3","gravatar_id":"","url":"https://api.github.com/users/Faryshta","html_url":"https://github.com/Faryshta","followers_url":"https://api.github.com/users/Faryshta/followers","following_url":"https://api.github.com/users/Faryshta/following{/other_user}","gists_url":"https://api.github.com/users/Faryshta/gists{/gist_id}","starred_url":"https://api.github.com/users/Faryshta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Faryshta/subscriptions","organizations_url":"https://api.github.com/users/Faryshta/orgs","repos_url":"https://api.github.com/users/Faryshta/repos","events_url":"https://api.github.com/users/Faryshta/events{/privacy}","received_events_url":"https://api.github.com/users/Faryshta/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-06-12T13:35:07Z","updated_at":"2016-07-21T15:19:25Z","closed_at":"2016-07-21T15:19:25Z","body":"How can I declare an attribute as unsafe? That means it can be massively assigned using the `Model::load()` method.\r\n\r\nRegulary if I want the 'paymet_method' to only be asigned during 'select-payment'. The code looks like this.\r\n\r\n```php\r\npublic function rules()\r\n{\r\n    return [['!payment_method'], 'safe', 'except' => 'select-payment'];\r\n}\r\n```\r\n\r\nUnfortunately workflow makes its own behaviors and they won't work during the `load()` execution\r\n\r\n```php\r\npublic function rules()\r\n{\r\n    return [['!payment_method'], 'safe', 'except' => WorkflowScenario::enterStatus('select-method')];\r\n}\r\n```\r\n\r\nThis one won't work since the scenario only exists during transitions, not during loading."}}
{"actor":{"display_login":"raoul2000"}}