I ended up solving this without using Rolify. In my user table, I have a field this is user_type, which someone selects customer or provider. Once this customer/provider field was getting populated within the provider_rating form, I was able to keep the association:
has_many :customer_ratings, foreign_key: 'customer'
When creating a rating for a customer, I used the following within my customer ratings controller:
def create
@user = User.find(params[:customer])
@cust_rating = @user.customer_ratings.build(customer_rating_params)
respond_to do |format|
if @cust_rating.save
format.html { redirect_to @user, notice: 'Thanks, your customer feedback has been recorded!' }
format.json { render action: 'show', status: :created, location: @customer_rating }
else
format.html { render action: 'new' }
format.json { render json: @customer_rating.errors, status: :unprocessable_entity }
end
end
end
and access the provider details with
customer_rating.provider