Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- I'm still getting this failure in my join or through table load attempts:
- [bary@miller qstj]$ rake db:migrate
- (in /home/bary/kitchen/cc/checkout/app/bary/rails/qstj)
- == 26 LoadPagespecPagesubsetData: migrating ===================================
- == 26 LoadPagespecPagesubsetData: reverting ===================================
- rake aborted!
- uninitialized constant LoadPagespecPagesubsetData::PagespecPagesubset
- (See full trace by running task with --trace)
- [bary@miller qstj]$
- ----snip----
- I defined the models/pagespecpagesubset.rb as follows:
- class PagespecPagesubset < ActiveRecord::Base
- belongs_to :pagespecs
- belongs_to :pagesubsets
- end
- and the load file is:
- require 'active_record/fixtures'
- class LoadPagespecPagesubsetData < ActiveRecord::Migration
- def self.up
- down
- directory = File.join(File.dirname(__FILE__), "dev_data")
- Fixtures.create_fixtures(directory, "pagespecs_pagesubsets")
- end
- def self.down
- PagespecPagesubset.delete_all
- end
- end
- ~
- ~
- ~
- "026_load_pagespec_pagesubset_data.rb" 15L, 300C written
- ----snip----
- 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:
- class Pagespec < ActiveRecord::Base
- validates_size_of :label, :in => 3..24
- validates_size_of :notes, :in => 0..512
- validates_size_of :urisuffix, :in => 5..255
- validates_format_of :urisuffix,
- :with => %r{\S+}i,
- :message => "Must be a URI suffix."
- has_many :httpcookies, :dependent => :delete_all
- has_many :httpheaders, :dependent => :delete_all
- has_many :releaserecords, :dependent => :destroy
- #has_and_belongs_to_many :pagesubsets
- has_many :pagesubsets, :through => :pagespecs_pagesubsets
- end
- ~
- ~
- "pagespec.rb" 13L, 543C
- ----snip----
- and
- class Pagesubset < ActiveRecord::Base
- validates_size_of :label, :in => 3..24
- validates_uniqueness_of :label
- validates_size_of :definition, :in => 0..512
- #has_and_belongs_to_many:pagespecs
- has_many :pagespecs, :through => :pagespecs_pagesubsets
- end
- ~
- "pagesubset.rb" 7L, 261C
- ----snip----
Add Comment
Please, Sign In to add comment