This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
2
action for polymorphic association
Post Body
Forgive me for this post. A totally noob question.
I have no idea how to create an action create for these model which are polymorphic, where a User will be created with a Brokerage Profile.
class User < ApplicationRecord
has_secure_password
TYPES = %w[Administrator].freeze
class Profile < ApplicationRecord
belongs_to :profilable, polymorphic: true
end
class Brokerage < User
has_one :profile, as: :profilable, foreign_key: :profilable_id,
class_name: 'Profile'
end
Author
Account Strength
100%
Account Age
10 years
Verified Email
Yes
Verified Flair
No
Total Karma
5,070
Link Karma
2,929
Comment Karma
2,074
Profile updated: 20 hours ago
Posts updated: 6 months ago
Subreddit
Post Details
We try to extract some basic information from the post title. This is not
always successful or accurate, please use your best judgement and compare
these values to the post title and body for confirmation.
- Posted
- 7 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/rails/comme...