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.27 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.5.26 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.4.45 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.5.25 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.5.23 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.4.44 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.5.22 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.4.43 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.5.21 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.4.42 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.5.20 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.4.41 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.5.19 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.4.40 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.5.18 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.4.39 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.5.17 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.4.38 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.5.16 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.4.37 lib/generators/workarea/seeds/seeds_generator.rb