forked from davetroy/votereport
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- added type field to users, Reviewer < User model
- added review fields to reports
- Loading branch information
1 parent
41adc00
commit 8ca87e1
Showing
7 changed files
with
58 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class Reviewer < User | ||
has_many :reports | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
class AddUsersType < ActiveRecord::Migration | ||
def self.up | ||
transaction do | ||
add_column :users, :type, :string, :limit => 30 | ||
add_index :users, :type | ||
end | ||
end | ||
|
||
def self.down | ||
remove_column :users, :type | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
class AddReportReviewAttrs < ActiveRecord::Migration | ||
def self.up | ||
# assigned_at, reviewed_at, reviewer_id | ||
transaction do | ||
add_column :reports, :assigned_at, :datetime | ||
add_column :reports, :reviewed_at, :datetime | ||
add_column :reports, :reviewer_id, :integer | ||
add_index :reports, :reviewer_id | ||
end | ||
end | ||
|
||
def self.down | ||
remove_column :reports, :assigned_at | ||
remove_column :reports, :reviewed_at | ||
remove_column :reports, :reviewer_id | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
require 'rubygems' | ||
begin | ||
require File.join(File.dirname(__FILE__), 'lib', 'haml') # From here | ||
rescue LoadError | ||
require 'haml' # From gem | ||
end | ||
|
||
Haml.init_rails(binding) |