OCTO-892: Document the field macro in the README#187
Merged
Conversation
Documents the `field` DSL macro (the primitive that every `t.<type>` shorthand, `timestamps`, and `optimistic_lock` delegate to), its `:required`/`:unique` positional flags, and the underlying `declare_field` class method, which can be called outside of a `declare_schema do ... end` block (e.g. from a shared concern). Co-authored-by: Cursor <cursoragent@cursor.com>
Docs-only release covering the field/declare_field documentation added for OCTO-892. Co-authored-by: Cursor <cursoragent@cursor.com>
ColinDKelley
requested review from
Copilot,
gmcgilvray,
jebentier and
ttstarck
and removed request for
Copilot
July 1, 2026 19:08
gmcgilvray
approved these changes
Jul 1, 2026
gmcgilvray
left a comment
There was a problem hiding this comment.
Thanks for doing this! 👍 though I did not dig through the docs for correctness, but appreciate the tag and pointing out this functionality.
Contributor
Author
|
@gmcgilvray I let Cursor do the digging, so I'm pretty sure the docs are correct. My feedback was just on its wording and structure. I'll merge and release and we can always fine tune if there's more feedback. (Update: before I can merge I need a 👍 from @ttstarck or @jebentier from the owning team.) |
jebentier
approved these changes
Jul 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
fieldDSL macro (the primitive underlying everyt.<type>shorthand,timestamps, andoptimistic_lock), including its:required/:uniquepositional flags.declare_fieldclass method, which can be called outside of adeclare_schema do ... endblock (e.g. from a shared concern), with an equivalent example for each style.4.0.3(docs-only release) and updates the CHANGELOG.Test plan
lib/declare_schema/dsl.rbandlib/declare_schema/model.rbbundle installsucceeds and picks updeclare_schema (4.0.3)Jira: OCTO-892
Made with Cursor