{"action":"created","issue":{"url":"https://api.github.com/repos/phalcon/cphalcon/issues/250","labels_url":"https://api.github.com/repos/phalcon/cphalcon/issues/250/labels{/name}","comments_url":"https://api.github.com/repos/phalcon/cphalcon/issues/250/comments","events_url":"https://api.github.com/repos/phalcon/cphalcon/issues/250/events","html_url":"https://github.com/phalcon/cphalcon/issues/250","id":9288638,"number":250,"title":"skipAttributesOnCreate not working","user":{"login":"theDisco","id":199368,"avatar_url":"https://avatars.githubusercontent.com/u/199368?v=3","gravatar_id":"","url":"https://api.github.com/users/theDisco","html_url":"https://github.com/theDisco","followers_url":"https://api.github.com/users/theDisco/followers","following_url":"https://api.github.com/users/theDisco/following{/other_user}","gists_url":"https://api.github.com/users/theDisco/gists{/gist_id}","starred_url":"https://api.github.com/users/theDisco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theDisco/subscriptions","organizations_url":"https://api.github.com/users/theDisco/orgs","repos_url":"https://api.github.com/users/theDisco/repos","events_url":"https://api.github.com/users/theDisco/events{/privacy}","received_events_url":"https://api.github.com/users/theDisco/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/phalcon/cphalcon/labels/Bug%20-%20Medium","name":"Bug - Medium","color":"d7e102"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/phalcon/cphalcon/milestones/7","html_url":"https://github.com/phalcon/cphalcon/milestones/0.8.0","labels_url":"https://api.github.com/repos/phalcon/cphalcon/milestones/7/labels","id":208681,"number":7,"title":"0.8.0","description":"","creator":{"login":"niden","id":1073784,"avatar_url":"https://avatars.githubusercontent.com/u/1073784?v=3","gravatar_id":"","url":"https://api.github.com/users/niden","html_url":"https://github.com/niden","followers_url":"https://api.github.com/users/niden/followers","following_url":"https://api.github.com/users/niden/following{/other_user}","gists_url":"https://api.github.com/users/niden/gists{/gist_id}","starred_url":"https://api.github.com/users/niden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/niden/subscriptions","organizations_url":"https://api.github.com/users/niden/orgs","repos_url":"https://api.github.com/users/niden/repos","events_url":"https://api.github.com/users/niden/events{/privacy}","received_events_url":"https://api.github.com/users/niden/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":28,"state":"closed","created_at":"2012-11-07T16:12:23Z","updated_at":"2013-01-09T17:05:37Z","due_on":"2013-01-10T08:00:00Z","closed_at":"2013-01-09T17:04:59Z"},"comments":7,"created_at":"2012-12-14T15:53:05Z","updated_at":"2015-10-16T06:43:08Z","closed_at":"2012-12-17T08:44:09Z","body":"Phalcon is ignoring default values defined for a field. I checked the documentation and I've found I can add skipAttributes to my models. Unfortunately it is not working.  I have created following MySQL table:\r\n\r\n```sql\r\nCREATE TABLE `default_values` (\r\n  `default_value_id` int unsigned NOT NULL AUTO_INCREMENT,\r\n  `is_valid` tinyint NULL DEFAULT 0,\r\n  PRIMARY KEY(`default_value_id`)\r\n) ENGINE=MyISAM;\r\n```\r\n\r\nMy model\r\n\r\n```php\r\n<?php\r\n\r\nnamespace Application\\Frontend\\Models;\r\n\r\nclass DefaultValues extends \\Phalcon\\Mvc\\Model\r\n{\r\n\tpublic function initialize()\r\n\t{\r\n\t\t$this->skipAttributesOnCreate(array('is_valid'));\r\n\t}\r\n\r\n\tpublic function getSource()\r\n\t{\r\n\t\treturn 'default_values';\r\n\t}\r\n}\r\n```\r\n\r\nMy controller\r\n\r\n```php\r\n<?php\r\n\r\nnamespace Application\\Frontend\\Controllers;\r\n\r\nclass TestController extends \\Phalcon\\Mvc\\Controller {\r\n\r\n\tpublic function testAction()\r\n\t{\r\n\t\t$category = new \\Application\\Frontend\\Models\\DefaultValues();\r\n\t\t$category->save();\r\n\t}\r\n\r\n}\r\n```\r\n\r\nAfter looking into error logs I've found following\r\n\r\n```\r\n[Fri Dec 14 16:36:40 2012] [error] [client 127.0.0.1] PHP Warning:  Phalcon\\\\Mvc\\\\Model\\\\MetaData::setAutomaticCreateAttributes() expects exactly 2 parameters, 1 given in /home/webwerk/www/phalcon/app/frontend/models/DefaultValues.php on line 9\r\n[Fri Dec 14 16:36:40 2012] [error] [client 127.0.0.1] PHP Stack trace:\r\n[Fri Dec 14 16:36:40 2012] [error] [client 127.0.0.1] PHP   1. {main}() /home/webwerk/www/phalcon/public/index.php:0\r\n[Fri Dec 14 16:36:40 2012] [error] [client 127.0.0.1] PHP   2. Phalcon\\\\Mvc\\\\Application->handle() /home/webwerk/www/phalcon/public/index.php:145\r\n[Fri Dec 14 16:36:40 2012] [error] [client 127.0.0.1] PHP   3. Application\\\\Frontend\\\\Controllers\\\\TestController->testAction() /home/webwerk/www/phalcon/public/index.php:0\r\n[Fri Dec 14 16:36:40 2012] [error] [client 127.0.0.1] PHP   4. Phalcon\\\\Mvc\\\\Model->__construct() /home/webwerk/www/phalcon/app/frontend/controllers/TestController.php:9\r\n[Fri Dec 14 16:36:40 2012] [error] [client 127.0.0.1] PHP   5. Application\\\\Frontend\\\\Models\\\\DefaultValues->initialize() /home/webwerk/www/phalcon/app/frontend/controllers/TestController.php:0\r\n[Fri Dec 14 16:36:40 2012] [error] [client 127.0.0.1] PHP   6. Phalcon\\\\Mvc\\\\Model->skipAttributesOnCreate() /home/webwerk/www/phalcon/app/frontend/models/DefaultValues.php:9\r\n```"},"comment":{"url":"https://api.github.com/repos/phalcon/cphalcon/issues/comments/148630664","html_url":"https://github.com/phalcon/cphalcon/issues/250#issuecomment-148630664","issue_url":"https://api.github.com/repos/phalcon/cphalcon/issues/250","id":148630664,"user":{"login":"theDisco","id":199368,"avatar_url":"https://avatars.githubusercontent.com/u/199368?v=3","gravatar_id":"","url":"https://api.github.com/users/theDisco","html_url":"https://github.com/theDisco","followers_url":"https://api.github.com/users/theDisco/followers","following_url":"https://api.github.com/users/theDisco/following{/other_user}","gists_url":"https://api.github.com/users/theDisco/gists{/gist_id}","starred_url":"https://api.github.com/users/theDisco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theDisco/subscriptions","organizations_url":"https://api.github.com/users/theDisco/orgs","repos_url":"https://api.github.com/users/theDisco/repos","events_url":"https://api.github.com/users/theDisco/events{/privacy}","received_events_url":"https://api.github.com/users/theDisco/received_events","type":"User","site_admin":false},"created_at":"2015-10-16T06:43:08Z","updated_at":"2015-10-16T06:43:08Z","body":"@duythien Can you post the output of `DESC users`? Maybe it just has a default value?"}}