ソースを参照

correct auto detect

euromark 11 年 前
コミット
5f676b6724
1 ファイル変更2 行追加1 行削除
  1. 2 1
      Model/Behavior/SluggedBehavior.php

+ 2 - 1
Model/Behavior/SluggedBehavior.php

@@ -93,7 +93,8 @@ class SluggedBehavior extends Behavior {
 		parent::__construct($table, $config);
 		parent::__construct($table, $config);
 
 
 		if (!$this->_config['length']) {
 		if (!$this->_config['length']) {
-			$this->_config['length'] = $table->schema()->column($this->_config['field'])['length'];
+			$length = $table->schema()->column($this->_config['field'])['length'];
+			$this->_config['length'] = min((int)$length, 255);
 		}
 		}
 
 
 		$this->_table = $table;
 		$this->_table = $table;