Class: Ghost::Seeder::Models::PostTagsSeed

Inherits:
GenericSeed
  • Object
show all
Defined in:
lib/ghost/seeder/models/post_tags_seed.rb

Instance Attribute Summary

Attributes inherited from GenericSeed

#attributes, #record

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

.klassObject



7
8
9
# File 'lib/ghost/seeder/models/post_tags_seed.rb', line 7

def self.klass
  PostTag
end

.seedsObject



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 ||
    tag = Tag.find_by! slug: ["tag_slug"]
    post = Post.find_by! slug: ["post_slug"]
    {
      tag_id: tag.id,
      post_id: post.id
    }
  end
end