Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 19 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -349,36 +349,17 @@ bee.first_name = "Queen"
bee.attributes # => { "First Name": "Queen", "Last Name": "Buzz" }
```

### FmRest::Layout.has_portal

You can define portal associations on your model wth `has_portal`, as such:

```ruby
class Honeybee < FmRest::Layout
has_portal :flowers
end

class Flower < FmRest::Layout
attributes :color, :species
end
```
#### Dirty attributes

See the [main document on portal associations](docs/Portals.md) for details.

### Dirty attributes

fmrest-ruby includes support for ActiveModel's Dirty mixin out of the box,
providing methods like:
fmrest-ruby includes support for ActiveModel's Dirty mixin for attributes
declared with `attributes`, providing methods like:

```ruby
bee = Honeybee.new

bee.changed? # => false

bee.name = "Maya"

bee.changed? # => true

bee.name_changed? # => true
```

Expand All @@ -388,6 +369,22 @@ to the server on save.
You can read more about [ActiveModel's Dirty in Rails
Guides](https://guides.rubyonrails.org/active_model_basics.html#dirty).

### FmRest::Layout.has_portal

You can define portal associations on your model wth `has_portal`, as such:

```ruby
class Honeybee < FmRest::Layout
has_portal :flowers
end

class Flower < FmRest::Layout
attributes :color, :species
end
```

See the [main document on portal associations](docs/Portals.md) for details.

### Query API

Since Spyke is API-agnostic it only provides a wide-purpose `.where` method for
Expand Down