class Notification < ActiveRecord::Base belongs_to :notifiable, polymorphic: true end class Message < ActiveRecord::Base has_one :notification, as: :notifiable end class Like < ActiveRecord::Base has_one :notification, as: :notifiable end ä¸è¡ã§è²ããªã¯ã©ã¹ã«å¯¾ããé¢é£ãæå®ã§ãã¦ä¾¿å©æãããã ã ããã£ã¦ããããå®æã«ä½¿ãåã«ã¡ããã¨èãããã ããªã¢ã¼ãã£ãã¯é¢é£ã¯åã«é¢é£ã®å®ç¾©ãçååããããã®ãã®ãããªãã ããªã¢ã¼ãã£ãã¯ã¨ããååã示ãæ§ã«ãããã¯å¤æ æ§ãæã£ããã®ã«å¯¾ããé¢é£ãå®ç¾©ããäºã§ãã£ã¦ãã¤ã³ã¿ã¼ãã§ã¼ã¹ã«å¯¾ããé¢é£ã®å®ç¾©ã ã¨ãããã¨
{{#tags}}- {{label}}
{{/tags}}