Skip to content

Commit

Permalink
Merge pull request #38 from s-nakajima/master
Browse files Browse the repository at this point in the history
インストール時、単言語で登録するように修正
  • Loading branch information
s-nakajima committed Dec 27, 2016
2 parents b169445 + b101581 commit 9c56876
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Config/Migration/1472409223_records.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class Records extends NetCommonsMigration {
'id' => '1',
'code' => 'en',
'weight' => '2',
'is_active' => true,
'is_active' => false,
),
array(
'id' => '2',
Expand Down
30 changes: 15 additions & 15 deletions Model/Language.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,24 @@ class Language extends M17nAppModel {
*/
public function beforeValidate($options = array()) {
$this->validate = Hash::merge($this->validate, array(
'code' => array(
'notBlank' => array(
'rule' => array('notBlank'),
'message' => __d('net_commons', 'Invalid request.'),
'code' => array(
'notBlank' => array(
'rule' => array('notBlank'),
'message' => __d('net_commons', 'Invalid request.'),
),
),
),
'weight' => array(
'numeric' => array(
'rule' => array('numeric'),
'message' => __d('net_commons', 'Invalid request.'),
'weight' => array(
'numeric' => array(
'rule' => array('numeric'),
'message' => __d('net_commons', 'Invalid request.'),
),
),
),
'is_active' => array(
'boolean' => array(
'rule' => array('boolean'),
'message' => __d('net_commons', 'Invalid request.'),
'is_active' => array(
'boolean' => array(
'rule' => array('boolean'),
'message' => __d('net_commons', 'Invalid request.'),
),
),
),
));

return parent::beforeValidate($options);
Expand Down

0 comments on commit 9c56876

Please sign in to comment.