Class: Napa::ActiveRecord

Inherits:
Object
  • Object
show all
Defined in:
lib/napa/activerecord.rb

Class Method Summary collapse

Class Method Details

.migration_template(migration_class) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/napa/activerecord.rb', line 4

def migration_template(migration_class)
  "    class \#{migration_class} < ActiveRecord::Migration\n      def up\n        # create_table :foo do |t|\n        #   t.string :name, :null => false\n        # end\n      end\n\n      def down\n        # drop_table :foo\n      end\n    end\n  MIGRATION\nend\n"