Closed jcs closed 14 years ago
I moved the check to Model#__call instead since making the change in Table#get_relationship would affect everything else that uses it. For example all has_many relationships would then be accessible with a singular and plural name like: $thread->post and $thread->posts.
http://github.com/kla/php-activerecord/commit/ee47efa34d552094aa6e8adcbac503914c235f40
$thread->build_post() returns an error, because the association is "posts", but it is confusing to say build_posts() when it just returns one object.
a fix is to check the relationships hash for the pluralized version of the name before returning an error, allowing build_post() to work.
http://github.com/jcs/halfmoon/commit/3a158faefc0c5d81dae76c8b5cf16cbac9c93f73