Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: a8fd92c86a
Fetching contributors…

Cannot retrieve contributors at this time

33 lines (22 sloc) 0.629 kB

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

Copyright © 2011 Annkissam. See LICENSE for details.

Jump to Line
Something went wrong with that request. Please try again.