Skip to content

dylancashman/acts_as_span

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

acts_as_span

ActiveRecord model w/ a start_date and an end_date

Getting Started

In your Gemfile:

gem "acts_as_span"

In your model:

class SpanRecord < ActiveRecord::Base
  acts_as_span
end

In your migrations:

class AddSpanToSpanRecord < ActiveRecord::Migration
  def self.up
    add_column :span_records, :start_date, :date
    add_column :span_records, :end_date, :date
  end

  def self.down
    remove_column :span_records, :start_date
    remove_column :span_records, :end_date
  end
end

Copyright © 2011 Annkissam. See LICENSE for details.