scopeMeta should use $this->getTable() instead of $this->table
eswinfen opened this issue · 7 comments
eswinfen commented
The scopeMeta function uses the table member $this->table, which is only set if there is an explicit override of the table name on a model. Instead it should use the $this->getTable() method and getQualifiedKeyName() method.
If the scopeMeta method is altered as follows it should work in all cases:
public function scopeMeta($query)
{
return $query->join($this->getTable(), $this->getQualifiedKeyName(), '=', $this->getMetaTable().$this->getMetaKeyName())
->select($this->getTable().'.*');
}
kodeine commented
@necenzurat can you please post a PR as well?
Thanks
necenzurat commented
due to the lack of inactivity, I thought you where dead and made a fork
shmuelgutman commented
+1
I get Base table or view not found
kodeine commented
@necenzurat please post a PR and i'll merge it right away
necenzurat commented
@kodeine no, i cannot, because i did not Github Fork your repo.
kodeine commented
fixed.