注: factory_girlã¯factory_botã«æ¹åããã¾ããã FactoryGirlã§has_manyãªé¢é£ãå®ç¾©ããæ¹æ³ããããã¥ã¡ã³ããã¿ãã ãã§ã¯åããã«ããã£ãã®ã§ã¡ã¢ãæ®ãã¾ã gemã®Versionã¯ãããã Ruby: 1.9.3-p392 Rails: 3.2.13 FactoryGirl: 4.2.0 ãµã³ãã«ã¨ãã¦ç§ç®(Subject)ãè¤æ°ã®åå (Unit)ãæã£ã¦ããã¨ãããã¼ã¿ãä½æãã¾ã Model # app/models/subject.rb class Subject < ActiveRecord::Base has_many :units validates_uniquness_of :code attr_accessible :code, :name end # app/models/unit.rb class Unit < ActiveR
{{#tags}}- {{label}}
{{/tags}}