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.4.27 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.5.4 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.4.26 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.5.3 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.4.25 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.5.2 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.4.24 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.5.1 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.4.23 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.4.22 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.5.0 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.4.21 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.5.0.beta.1 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.4.20 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.4.19 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.4.18 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.4.17 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.4.16 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.4.15 lib/generators/workarea/seeds/seeds_generator.rb
workarea-core-3.4.14 lib/generators/workarea/seeds/seeds_generator.rb