Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
waymondo committed Dec 24, 2023
1 parent c70b170 commit f38e92d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down

0 comments on commit f38e92d

Please sign in to comment.