Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Related models with multiple word attributes throws error at line 105 in Revision.php #37

Closed
cjke opened this issue Feb 26, 2014 · 1 comment

Comments

@cjke
Copy link

cjke commented Feb 26, 2014

Let's say I have a model with the following revision rules:

protected $keepRevisionOf = array(
        'title',
        'filename',
        'published_status_id'
);

On the model, I would also have:

public function publishedStatus() 
    {
        return $this->hasOne('PublishedStatus', 'id', 'published_status_id');
    }

But it fails, because it is looking for published_status with method_exists. It should be looking for publishedStatus (from the point of view that relationships should be defined with camel case I believe). I wrapped camel_Case around the str_replace on line 102, and it seems to work fine. 
@duellsy
Copy link
Member

duellsy commented Feb 27, 2014

Latest commit to the dev branch now checks for the camel cased version if the original check failed.

7aa1868

@duellsy duellsy closed this as completed Feb 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants