Railsã®Activerecordã§ä¸éãã¼ãã«ã¨é¢é£ãã¼ãã«ãä¸æ°ã«ã¤ã³ãµã¼ãããæ¹æ³ã§ãã ã¢ãã«ã®é¢ä¿ã¯ã以ä¸ã®æ§ã« User <=> UserSchedule <=> Schedule Userã¨Scheduleã®éã«UserScheduleãä¸éãã¼ãã«ã¨ãã¦åå¨ãããã¨ãæ³å®ãã¾ãã Activerecodeã®é¢é£ãã¼ãã«ã®è¨å®ã¯ä»¥ä¸ã®ããã«ãªãã¾ãã User, Schedulee, UserScheduleã«ããããhas_many, through, belongs_toãè¨å®ãã¾ãã è¨å®ã«é¢ãã¦ã¯ã1å¯¾å¤ ã å¤å¯¾å¤ã§å¤ãã£ã¦ããã®ã§é©å®å¤æ´ãã¦ãã ããã ä¸è¨ã®ä¾ã§ã¯å¤å¯¾å¤ãæ³å®ãã¦ãã¾ãã user.rb class User < ActiveRecord::Base has_many :user_schedules has_many :schedules, t
{{#tags}}- {{label}}
{{/tags}}