Guest User

Untitled

a guest
Apr 19th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.96 KB | None | 0 0
  1.  
  2. I'm still getting this failure in my join or through table load attempts:
  3.  
  4.  
  5. [bary@miller qstj]$ rake db:migrate
  6. (in /home/bary/kitchen/cc/checkout/app/bary/rails/qstj)
  7. == 26 LoadPagespecPagesubsetData: migrating ===================================
  8. == 26 LoadPagespecPagesubsetData: reverting ===================================
  9. rake aborted!
  10. uninitialized constant LoadPagespecPagesubsetData::PagespecPagesubset
  11.  
  12. (See full trace by running task with --trace)
  13. [bary@miller qstj]$
  14. ----snip----
  15. I defined the models/pagespecpagesubset.rb as follows:
  16.  
  17. class PagespecPagesubset < ActiveRecord::Base
  18. belongs_to :pagespecs
  19. belongs_to :pagesubsets
  20. end
  21.  
  22. and the load file is:
  23.  
  24. require 'active_record/fixtures'
  25.  
  26. class LoadPagespecPagesubsetData < ActiveRecord::Migration
  27. def self.up
  28.  
  29. down
  30.  
  31. directory = File.join(File.dirname(__FILE__), "dev_data")
  32. Fixtures.create_fixtures(directory, "pagespecs_pagesubsets")
  33. end
  34.  
  35. def self.down
  36. PagespecPagesubset.delete_all
  37. end
  38. end
  39. ~
  40. ~
  41. ~
  42. "026_load_pagespec_pagesubset_data.rb" 15L, 300C written
  43. ----snip----
  44. None of my other load files require anything beyond this to read the yaml in my dev_data subdirectory, but this is the first attempt to load a join table. I already changed the habtm stuff over as follows:
  45.  
  46. class Pagespec < ActiveRecord::Base
  47. validates_size_of :label, :in => 3..24
  48. validates_size_of :notes, :in => 0..512
  49. validates_size_of :urisuffix, :in => 5..255
  50. validates_format_of :urisuffix,
  51. :with => %r{\S+}i,
  52. :message => "Must be a URI suffix."
  53. has_many :httpcookies, :dependent => :delete_all
  54. has_many :httpheaders, :dependent => :delete_all
  55. has_many :releaserecords, :dependent => :destroy
  56. #has_and_belongs_to_many :pagesubsets
  57. has_many :pagesubsets, :through => :pagespecs_pagesubsets
  58. end
  59. ~
  60. ~
  61. "pagespec.rb" 13L, 543C
  62. ----snip----
  63. and
  64. class Pagesubset < ActiveRecord::Base
  65. validates_size_of :label, :in => 3..24
  66. validates_uniqueness_of :label
  67. validates_size_of :definition, :in => 0..512
  68. #has_and_belongs_to_many:pagespecs
  69. has_many :pagespecs, :through => :pagespecs_pagesubsets
  70. end
  71. ~
  72. "pagesubset.rb" 7L, 261C
  73. ----snip----
Add Comment
Please, Sign In to add comment