forked from scaffeinate/socify
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:sudharti/socify
- Loading branch information
Showing
18 changed files
with
389 additions
and
79 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
This file was deleted.
Oops, something went wrong.
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
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,31 @@ | ||
# Be sure to restart your server when you modify this file. | ||
# | ||
# 5 stars is a common ranking use case. They are not given at specified | ||
# actions like badges, you should define a cron job to test if ranks are to be | ||
# granted. | ||
# | ||
# +set_rank+ accepts: | ||
# * :+level+ ranking level (greater is better) | ||
# * :+to+ model or scope to check if new rankings apply | ||
# * :+level_name+ attribute name (default is empty and results in 'level' | ||
# attribute, if set it's appended like 'level_#{level_name}') | ||
|
||
module Merit | ||
class RankRules | ||
include Merit::RankRulesMethods | ||
|
||
def initialize | ||
# set_rank :level => 1, :to => Commiter.active do |commiter| | ||
# commiter.repositories.count > 1 && commiter.followers >= 10 | ||
# end | ||
# | ||
# set_rank :level => 2, :to => Commiter.active do |commiter| | ||
# commiter.branches.count > 1 && commiter.followers >= 10 | ||
# end | ||
# | ||
# set_rank :level => 3, :to => Commiter.active do |commiter| | ||
# commiter.branches.count > 2 && commiter.followers >= 20 | ||
# end | ||
end | ||
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
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
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,6 @@ | ||
class AddMeritFieldsToUsers < ActiveRecord::Migration | ||
def change | ||
add_column :users, :sash_id, :integer | ||
add_column :users, :level, :integer, :default => 0 | ||
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,15 @@ | ||
class CreateMeritActions < ActiveRecord::Migration | ||
def change | ||
create_table :merit_actions do |t| | ||
t.integer :user_id | ||
t.string :action_method | ||
t.integer :action_value | ||
t.boolean :had_errors, default: false | ||
t.string :target_model | ||
t.integer :target_id | ||
t.text :target_data | ||
t.boolean :processed, default: false | ||
t.timestamps | ||
end | ||
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,11 @@ | ||
class CreateMeritActivityLogs < ActiveRecord::Migration | ||
def change | ||
create_table :merit_activity_logs do |t| | ||
t.integer :action_id | ||
t.string :related_change_type | ||
t.integer :related_change_id | ||
t.string :description | ||
t.datetime :created_at | ||
end | ||
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,7 @@ | ||
class CreateSashes < ActiveRecord::Migration | ||
def change | ||
create_table :sashes do |t| | ||
t.timestamps | ||
end | ||
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,16 @@ | ||
class CreateBadgesSashes < ActiveRecord::Migration | ||
def self.up | ||
create_table :badges_sashes do |t| | ||
t.integer :badge_id, :sash_id | ||
t.boolean :notified_user, default: false | ||
t.datetime :created_at | ||
end | ||
add_index :badges_sashes, [:badge_id, :sash_id] | ||
add_index :badges_sashes, :badge_id | ||
add_index :badges_sashes, :sash_id | ||
end | ||
|
||
def self.down | ||
drop_table :badges_sashes | ||
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,15 @@ | ||
class CreateScoresAndPoints < ActiveRecord::Migration | ||
def change | ||
create_table :merit_scores do |t| | ||
t.references :sash | ||
t.string :category, default: 'default' | ||
end | ||
|
||
create_table :merit_score_points do |t| | ||
t.references :score | ||
t.integer :num_points, default: 0 | ||
t.string :log | ||
t.datetime :created_at | ||
end | ||
end | ||
end |
Oops, something went wrong.