Sha256: 44e1e9fd7209fe18698893295c7adcc067579bed5f0ca0116b87df519f92cc16

Contents?: true

Size: 474 Bytes

Versions: 3

Compression:

Stored size: 474 Bytes

Contents

class Create<%= table_name.camelize %> < ActiveRecord::Migration
  def self.up
    create_table :<%= table_name %> do |t|
      t.string :name
      t.datetime :start_at
      t.datetime :end_at
      <%- if options[:use_all_day] -%>
      t.boolean :all_day, :default => false
      <%- end -%>
      <%- if options[:use_color] -%>
      t.string :color
      <%- end -%>
      
      t.timestamps
    end
  end

  def self.down
    drop_table :<%= table_name %>
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
event-calendar-2.3.3 lib/generators/event_calendar/templates/migration.rb.erb
event-calendar-2.3.2 lib/generators/event_calendar/templates/migration.rb.erb
event-calendar-2.3.1 lib/generators/event_calendar/templates/migration.rb.erb