Class: Ghost::Seeder::Models::PostTagsSeed
- Inherits:
-
GenericSeed
- Object
- GenericSeed
- Ghost::Seeder::Models::PostTagsSeed
- Defined in:
- lib/ghost/seeder/models/post_tags_seed.rb
Instance Attribute Summary
Attributes inherited from GenericSeed
Class Method Summary collapse
Methods inherited from GenericSeed
#initialize, load_fixtures, perform_queries, #seed!, wipe_records!, yaml_bindings
Constructor Details
This class inherits a constructor from Ghost::Seeder::Models::GenericSeed
Class Method Details
.klass ⇒ Object
7 8 9 |
# File 'lib/ghost/seeder/models/post_tags_seed.rb', line 7 def self.klass PostTag end |
.seeds ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/ghost/seeder/models/post_tags_seed.rb', line 11 def self.seeds load_fixtures("posts_tags").map do |post_tag| tag = Tag.find_by! slug: post_tag["tag_slug"] post = Post.find_by! slug: post_tag["post_slug"] { tag_id: tag.id, post_id: post.id } end end |