Skip to content

Commit

Permalink
modify key spec
Browse files Browse the repository at this point in the history
  • Loading branch information
sadapon2008 committed Feb 20, 2015
1 parent 7f6717b commit 9f5c073
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Model/Datasource/Database/MysqlCollate.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ protected function _parseKey($key, $value, Model $Model = null) {
$result = parent::_parseKey($key, $value, $Model);

if(($Model !== null) && ($Model->Behaviors->loaded('MysqlCollate'))) {
if(preg_match('/^' . $Model->alias . '\.([^\s]+)/', $key, $matches)) {
if(preg_match('/^([^\s]+)/', $key, $matches)) {
$field = $matches[1];
$collate = $Model->getMysqlCollate($field);
if(!empty($collate)) {
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ $options = array(
$this->Post->Behaviors->load(
'MysqlCollate.MysqlCollate',
array(
'title' => 'utf8_unicode_ci',
'Post.title' => 'utf8_unicode_ci',
)
);

Expand Down

0 comments on commit 9f5c073

Please sign in to comment.