Skip to content

Commit 5d86b70

Browse files
authored
project name fixes and wording adjustments, etc. (#68)
1 parent 5a733b7 commit 5d86b70

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

README.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# ActiveRecordCompose
22

33
ActiveRecordCompose lets you build form objects that combine multiple ActiveRecord models into a single, unified interface.
4-
More than just a simple form object, it is designed as a **business-oriented composed model** that encapsulates complex operations-such as user registration spanning multiple tables-making them easier to write, validate, and maintain.
4+
More than a simple form object, ActiveRecordCompose is designed as a **business-oriented composed model** that encapsulates complex operations, such as user registration spanning multiple tables, making them easier to write, validate, and maintain.
55

66
[![Gem Version](https://badge.fury.io/rb/active_record_compose.svg)](https://badge.fury.io/rb/active_record_compose)
77
![CI](https://github.com/hamajyotan/active_record_compose/workflows/CI/badge.svg)
@@ -29,15 +29,14 @@ More than just a simple form object, it is designed as a **business-oriented com
2929

3030
## Motivation
3131

32-
In Rails, `ActiveRecord::Base` is responsible for persisting data to the database.
33-
By defining validations and callbacks, you can model use cases effectively.
32+
In Rails, `ActiveRecord::Base` is responsible for persisting data to the database and modeling application behavior through validations and callbacks.
3433

3534
However, when a single model must serve multiple different use cases, you often end up with conditional validations (`on: :context`) or workarounds like `save(validate: false)`.
3635
This mixes unrelated concerns into one model, leading to unnecessary complexity.
3736

38-
`ActiveModel::Model` helps here — it provides the familiar API (`attribute`, `errors`, validations, callbacks) without persistence, so you can isolate logic per use case.
37+
`ActiveModel::Model` helps address this by providing a familiar API (`attribute`, `errors`, validations, callbacks) without persistence, allowing you to isolate logic per use case.
3938

40-
**ActiveRecordCompose** builds on `ActiveModel::Model` and is a powerful **business object** that acts as a first-class model within Rails.
39+
**ActiveRecordCompose** builds on `ActiveModel::Model` and provides a powerful **business object** that acts as a first-class model within Rails.
4140
- Transparently accesses attributes across multiple models
4241
- Saves all associated models atomically in a transaction
4342
- Collects and exposes error information consistently
@@ -106,7 +105,7 @@ class UserRegistration < ActiveRecordCompose::Model
106105
end
107106
```
108107

109-
Usage:
108+
Example usage:
110109

111110
```ruby
112111
# === Standalone script ===
@@ -174,7 +173,7 @@ registration.attributes
174173

175174
### Unified Error Handling
176175

177-
Validation errors from inner models are collected into the composed model:
176+
Validation errors from the inner models are collected into the composed object:
178177

179178
```ruby
180179
user_registration = UserRegistration.new(
@@ -274,7 +273,7 @@ model.save
274273

275274
### Notes on adding models dynamically
276275

277-
Avoid adding `models` to the models array **after validation has already run**
276+
Avoid adding models to the `models` array **after validation has already run**
278277
(for example, inside `after_validation` or `before_save` callbacks).
279278

280279
```ruby
@@ -323,5 +322,5 @@ The gem is available as open source under the terms of the [MIT License](https:/
323322

324323
## Code of Conduct
325324

326-
Everyone interacting in the ActiveRecord::Compose project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/hamajyotan/active_record_compose/blob/main/CODE_OF_CONDUCT.md).
325+
Everyone interacting in the ActiveRecordCompose project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/hamajyotan/active_record_compose/blob/main/CODE_OF_CONDUCT.md).
327326

0 commit comments

Comments
 (0)