Soc/app/models/learning_goal.rb

18 lines
368 B
Ruby
Raw Normal View History

2024-01-06 09:42:36 +00:00
class LearningGoal < ApplicationRecord
belongs_to :user
2024-01-06 10:29:41 +00:00
has_rich_text :description
has_rich_text :retrospective
2024-01-06 09:42:36 +00:00
validates :title, presence: true
2024-01-06 11:10:56 +00:00
has_and_belongs_to_many :tags
accepts_nested_attributes_for :tags
def microposts
microposts = Micropost.none
tags.each { |tag| microposts = microposts.or(tag.microposts) }
microposts
end
2024-01-06 09:42:36 +00:00
end