diff --git a/README.md b/README.md index 18af970..349fddd 100644 --- a/README.md +++ b/README.md @@ -143,11 +143,12 @@ Including `Hoardable::Model` into your source model modifies its default scope t query the parent table: ```ruby -Post.where(state: :draft).to_sql # => SELECT posts.* FROM posts WHERE posts.tableoid = CAST('posts' AS regclass) AND posts.status = 'draft' +Post.where(state: :draft).to_sql # => SELECT posts.* FROM ONLY posts WHERE posts.status = 'draft' ``` -_*Note*:_ If you are executing raw SQL, you will need to include this clause if you do not wish to -return versions in the results. +_*Note*:_ If you are executing raw SQL, you will need to include the `ONLY` keyword you see above to +the select statement if you do not wish to return versions in the results. Learn more about table +inheritance in [the PostgreSQL documentation](https://www.postgresql.org/docs/current/ddl-inherit.html). Since a `PostVersion` is an `ActiveRecord` class, you can query them like another model resource: