Rails app has trouble with inter-model saving

前端 未结 2 723
无人共我
无人共我 2021-01-29 04:37

I\'m working on an app that downloads meta tags from websites and saves then. The downloading happens in a model called Site. I\'d like to save off the downloaded

2条回答
  •  旧巷少年郎
    2021-01-29 05:25

    By inspection, the offending line appears to be:

    self.robots_tags.robots_meta = tag
    

    You should iterate over self.robots_tags instead, with something like:

    self.robots_tags.each do |robot_tag|
      robot_tag.robots_meta = tag
    end
    

提交回复
热议问题