You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+16Lines changed: 16 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -452,6 +452,22 @@ Her expects all `User` resources to have an `:organization_id` (or `:_organizati
452
452
Her::Errors::PathError:Missing:_organization_id parameter to build the request path. Path is `organizations/:organization_id/users`. Parameters are `{ … }`.
453
453
```
454
454
455
+
#### Associations with custom attributes
456
+
457
+
Associations can also be made using custom attributes:
458
+
459
+
```ruby
460
+
classUser
461
+
includeHer::Model
462
+
belongs_to :owns, class_name:"Organization"
463
+
end
464
+
465
+
classOrganization
466
+
includeHer::Model
467
+
has_many :owners, class_name:"User"
468
+
end
469
+
```
470
+
455
471
### Validations
456
472
457
473
Her includes `ActiveModel::Validations` so you can declare validations the same way you do in Rails.
0 commit comments