I have a user#show
view and also a membership#show
view.
The users#show
view has the path
/users/john-mcenroe
The membership#show
view will have the path
/org-name/memberships/john-mcenroe
in other words, the user#show and org#show view both have identical slugs
For the sake of lookup speed I assume the best thing to do is to mirror the slug column from user on the membership model too. To that end I've created a user observer that updates the membership whenever the user's slug changes.
Is an observer the best way to echo de-normalised data across DB tables? Is there a native rails way to do this instead (an equivalent to counter_cache for isntance)?