Ruby on Rails named class property of model
问题 I have two classes Product and user which have a has_many relationship with a polymorphic type as such. class User < ActiveRecord::Base has_many :pictures, as: :imageable end class Product < ActiveRecord::Base has_many :pictures, as: :imageable end class Picture < ActiveRecord::Base belongs_to :imageable, polymorphic: true end I want to also add a new property to the user models of profile_picture so @user.profile_picture will return a picture object. how can this be achieved? In particular