Right now I'm trying to create a one-sided follow/unfollow relationship where a user can follow/unfollow a celebrity. Despite the gems available I'd like to learn how to create this from scratch.
The posts I've found online seem to only incorporate a self-referential style where a model instance can only follow one of its kind (a user can only follow other users). As a starting point point I've used this post for the initial setup. I'm just not sure how to re-configure the associations for models:
class User < ActiveRecord::Base
end
class Following < ActiveRecord::Base
end
class Celebrity < ActiveRecord::Base
end