Sha256: 60456dd542bddb65a3a87ae302f5ec32ccd4e38906d72b16ad67b7748fb53d69

Contents?: true

Size: 885 Bytes

Versions: 5

Compression:

Stored size: 885 Bytes

Contents

module Kryptonite
  class BasicsGenerator < Rails::Generators::Base
    
      include Rails::Generators::Migration
      source_root File.expand_path('../templates', __FILE__)
  
      def generate_files
        puts "*** WARNING - Generating basic content and asset files. Make sure you have backed up any files before overwriting them. ***"
        generate "model Content content_key:string body:text"
        generate "kryptonite:scaffold Content content_key:string body:text"
        generate "model Asset content_id:integer file_file_name:string file_content_type:string file_file_size:integer file_updated_at:datetime"
        generate "kryptonite:scaffold Asset content_id:integer file_file_name:string"
        
        #contents controller
        copy_file "app/controller/kryptonite/contents_controller.rb", "app/helpers/kryptonite/config_helper.rb"

      end  
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
kryptonite-0.1.0 lib/generators/kryptonite/basics/basics_generator.rb
kryptonite-0.0.10 lib/generators/kryptonite/basics/basics_generator.rb
kryptonite-0.0.9 lib/generators/kryptonite/basics/basics_generator.rb
kryptonite-0.0.8 lib/generators/kryptonite/basics/basics_generator.rb
kryptonite-0.0.7 lib/generators/kryptonite/basics/basics_generator.rb