Sha256: 799d4a4f10b895333dbac23676db3017304c8b1c8fe83e23df6df95e506c5038

Contents?: true

Size: 452 Bytes

Versions: 62

Compression:

Stored size: 452 Bytes

Contents

module Workarea
  class SeedsGenerator < Rails::Generators::NamedBase
    source_root File.expand_path('../templates', __FILE__)

    def copy_seeds
      template 'seeds.rb.erb', "app/seeds/workarea/#{file_name}_seeds.rb"
    end

    def add_seeds_to_workarea_initializer
      inject_into_file 'config/initializers/workarea.rb', before: "\nend" do
        "\n\n\s\sconfig.seeds << 'Workarea::#{file_name.camelize}Seeds'"
      end
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
workarea-core-3.5.15 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.4.36 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.5.14 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.4.35 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.5.13 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.4.34 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.5.12 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.4.33 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.5.11 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.5.10 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.4.32 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.5.9 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.4.31 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.5.8 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.4.30 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.5.7 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.4.29 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.5.6 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.4.28 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.5.5 lib/generators/workarea/seeds/seeds_generator.rb