Skip to content

Adjust documentation to explain dirty tracking #57

Closed

Description

@mameier

In my setup (fmrest v0.27.0) dirty did not work as described in the README.
When I define a model as (cited from README, layout and connection is missing in this part of the README):

class Honeybee < FmRest::Layout
end

then

bee = Honeybee.new

bee.name = "Hutch"
bee.save # POST request (creates new BUT EMPTY record)

bee.name = "ハッチ"
bee.save # PATCH request (WITHOUT ANY DATA)

To make the example work, I have to declare all Filemaker fields as attributes:

class Honeybee < FmRest::Layout
attributes name: "Bee Name", age: "Bee Age", created_on: "Created On" 
end

The README seems to imply that fields are declared as attributes automatically, which is not the case.
Only the call to attributes registers the fields to ActiveModel::Dirty and monitors changed attributes.
This can be tideous with layouts with many fields.

This should be named in the docs.

Activity

  1. pilaf commented on Aug 7, 2026

    @pilaf
    Collaborator

    @mameier Thanks for taking the time to report this, and good catch. I'll update the README.

    Unfortunately there are no plans to support dirty attributes without declaring them with attributes first.

  2. pilaf commented on Aug 7, 2026

    @pilaf
    Collaborator

    Updated README in #58

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions