Skip to content

Commit a3749de

Browse files
committed
Temp Fix bug : Team management WIP
1 parent d24d28a commit a3749de

File tree

90 files changed

+1310
-742
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+1310
-742
lines changed

app/controllers/application_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def destination_url
166166
end
167167

168168
def access_required
169-
redirect_to(root_url) if !signed_in?
169+
redirect_to(root_url) unless signed_in?
170170
end
171171

172172
def viewing_self?

app/controllers/teams_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def upgrade
158158

159159
current_user.seen(:product_description) if signed_in?
160160
@team = (current_user && current_user.team) || Team.new
161-
store_location! if !signed_in?
161+
store_location! unless signed_in?
162162

163163
if upgrade_params[:discount] == ENV['DISCOUNT_TOKEN']
164164
session[:discount] = ENV['DISCOUNT_TOKEN']

app/models/api_access.rb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
# == Schema Information
2+
#
3+
# Table name: api_accesses
4+
#
5+
# id :integer not null, primary key
6+
# api_key :string(255)
7+
# awards :text
8+
# created_at :datetime
9+
# updated_at :datetime
10+
#
11+
112
class ApiAccess < ActiveRecord::Base
213
serialize :awards, Array
314

@@ -11,14 +22,3 @@ def can_award?(badge_name)
1122
awards.include? badge_name
1223
end
1324
end
14-
15-
# == Schema Information
16-
#
17-
# Table name: api_accesses
18-
#
19-
# id :integer not null, primary key
20-
# api_key :string(255)
21-
# awards :text
22-
# created_at :datetime
23-
# updated_at :datetime
24-
#

app/models/available_coupon.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
class AvailableCoupon < ActiveRecord::Base
2-
end
3-
41
# == Schema Information
52
#
63
# Table name: available_coupons
@@ -10,3 +7,6 @@ class AvailableCoupon < ActiveRecord::Base
107
# peepcode_coupon :string(255)
118
# recipes_coupon :string(255)
129
#
10+
11+
class AvailableCoupon < ActiveRecord::Base
12+
end

app/models/badge.rb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
# == Schema Information
2+
#
3+
# Table name: badges
4+
#
5+
# id :integer not null, primary key
6+
# created_at :datetime
7+
# updated_at :datetime
8+
# user_id :integer
9+
# badge_class_name :string(255)
10+
#
11+
112
class Badge < ActiveRecord::Base
213
belongs_to :user, counter_cache: :badges_count, touch: true
314
validates_uniqueness_of :badge_class_name, scope: :user_id
@@ -96,14 +107,3 @@ def event_type
96107
:unlocked_achievement
97108
end
98109
end
99-
100-
# == Schema Information
101-
#
102-
# Table name: badges
103-
#
104-
# id :integer not null, primary key
105-
# created_at :datetime
106-
# updated_at :datetime
107-
# user_id :integer
108-
# badge_class_name :string(255)
109-
#

app/models/comment.rb

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
# == Schema Information
2+
#
3+
# Table name: comments
4+
#
5+
# id :integer not null, primary key
6+
# title :string(50) default("")
7+
# comment :text default("")
8+
# commentable_id :integer
9+
# commentable_type :string(255)
10+
# user_id :integer
11+
# likes_cache :integer default(0)
12+
# likes_value_cache :integer default(0)
13+
# created_at :datetime
14+
# updated_at :datetime
15+
# likes_count :integer default(0)
16+
#
17+
118
class Comment < ActiveRecord::Base
219
include ActsAsCommentable::Comment
320
include Rakismet::Model
@@ -136,20 +153,3 @@ def analyze_spam
136153
AnalyzeSpamJob.perform_async({ id: id, klass: self.class.name })
137154
end
138155
end
139-
140-
# == Schema Information
141-
#
142-
# Table name: comments
143-
#
144-
# id :integer not null, primary key
145-
# title :string(50) default("")
146-
# comment :text default("")
147-
# commentable_id :integer
148-
# commentable_type :string(255)
149-
# user_id :integer
150-
# likes_cache :integer default(0)
151-
# likes_value_cache :integer default(0)
152-
# created_at :datetime
153-
# updated_at :datetime
154-
# likes_count :integer default(0)
155-
#

app/models/country.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
class Country < ActiveRecord::Base
2-
end
3-
41
# == Schema Information
52
#
63
# Table name: countries
@@ -11,3 +8,6 @@ class Country < ActiveRecord::Base
118
# created_at :datetime
129
# updated_at :datetime
1310
#
11+
12+
class Country < ActiveRecord::Base
13+
end

app/models/endorsement.rb

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
# == Schema Information
2+
#
3+
# Table name: endorsements
4+
#
5+
# id :integer not null, primary key
6+
# endorsed_user_id :integer
7+
# endorsing_user_id :integer
8+
# specialty :string(255)
9+
# created_at :datetime
10+
# updated_at :datetime
11+
# skill_id :integer
12+
#
13+
114
class Endorsement < ActiveRecord::Base
215
belongs_to :endorsed, class_name: User.name, foreign_key: :endorsed_user_id, counter_cache: :endorsements_count, touch: true
316
belongs_to :endorser, class_name: User.name, foreign_key: :endorsing_user_id
@@ -21,16 +34,3 @@ def event_type
2134
:endorsement
2235
end
2336
end
24-
25-
# == Schema Information
26-
#
27-
# Table name: endorsements
28-
#
29-
# id :integer not null, primary key
30-
# endorsed_user_id :integer
31-
# endorsing_user_id :integer
32-
# specialty :string(255)
33-
# created_at :datetime
34-
# updated_at :datetime
35-
# skill_id :integer
36-
#

app/models/fact.rb

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
# == Schema Information
2+
#
3+
# Table name: facts
4+
#
5+
# id :integer not null, primary key
6+
# identity :string(255)
7+
# owner :string(255)
8+
# name :string(255)
9+
# url :string(255)
10+
# tags :text
11+
# metadata :text
12+
# relevant_on :datetime
13+
# created_at :datetime
14+
# updated_at :datetime
15+
#
16+
117
class Fact < ActiveRecord::Base
218
serialize :tags, Array
319
serialize :metadata, Hash
@@ -62,19 +78,3 @@ def user
6278
User.find_by_provider_username(username, service)
6379
end
6480
end
65-
66-
# == Schema Information
67-
#
68-
# Table name: facts
69-
#
70-
# id :integer not null, primary key
71-
# identity :string(255)
72-
# owner :string(255)
73-
# name :string(255)
74-
# url :string(255)
75-
# tags :text
76-
# metadata :text
77-
# relevant_on :datetime
78-
# created_at :datetime
79-
# updated_at :datetime
80-
#

app/models/follow.rb

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# == Schema Information
2+
#
3+
# Table name: follows
4+
#
5+
# id :integer not null, primary key
6+
# followable_id :integer not null
7+
# followable_type :string(255) not null
8+
# follower_id :integer not null
9+
# follower_type :string(255) not null
10+
# blocked :boolean default(FALSE), not null
11+
# created_at :datetime
12+
# updated_at :datetime
13+
#
14+
115
class Follow < ActiveRecord::Base
216
extend ActsAsFollower::FollowerLib
317
extend ActsAsFollower::FollowScopes
@@ -34,17 +48,3 @@ def event_type
3448
"followed_#{followable.class.name.downcase}".to_sym
3549
end
3650
end
37-
38-
# == Schema Information
39-
#
40-
# Table name: follows
41-
#
42-
# id :integer not null, primary key
43-
# followable_id :integer not null
44-
# followable_type :string(255) not null
45-
# follower_id :integer not null
46-
# follower_type :string(255) not null
47-
# blocked :boolean default(FALSE), not null
48-
# created_at :datetime
49-
# updated_at :datetime
50-
#

app/models/followed_team.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
class FollowedTeam < ActiveRecord::Base
2-
belongs_to :team
3-
belongs_to :user
4-
end
5-
61
# == Schema Information
72
#
83
# Table name: followed_teams
@@ -13,3 +8,8 @@ class FollowedTeam < ActiveRecord::Base
138
# created_at :datetime default(2012-03-12 21:01:09 UTC)
149
# team_id :integer
1510
#
11+
12+
class FollowedTeam < ActiveRecord::Base
13+
belongs_to :team
14+
belongs_to :user
15+
end

app/models/github_assignment.rb

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
# == Schema Information
2+
#
3+
# Table name: github_assignments
4+
#
5+
# id :integer not null, primary key
6+
# github_username :string(255)
7+
# repo_url :string(255)
8+
# tag :string(255)
9+
# created_at :datetime
10+
# updated_at :datetime
11+
# badge_class_name :string(255)
12+
#
13+
114
class GithubAssignment < ActiveRecord::Base
215

316
scope :badge_assignments, where(repo_url: nil)
@@ -16,16 +29,3 @@ def self.for_github_username(github_username)
1629
end
1730

1831
end
19-
20-
# == Schema Information
21-
#
22-
# Table name: github_assignments
23-
#
24-
# id :integer not null, primary key
25-
# github_username :string(255)
26-
# repo_url :string(255)
27-
# tag :string(255)
28-
# created_at :datetime
29-
# updated_at :datetime
30-
# badge_class_name :string(255)
31-
#

app/models/highlight.rb

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
# == Schema Information
2+
#
3+
# Table name: highlights
4+
#
5+
# id :integer not null, primary key
6+
# user_id :integer
7+
# description :text
8+
# created_at :datetime
9+
# updated_at :datetime
10+
# featured :boolean default(FALSE)
11+
#
12+
113
class Highlight < ActiveRecord::Base
214
belongs_to :user
315

@@ -20,15 +32,3 @@ def add_to_timeline
2032
@event = Event.create_highlight_event(self.user, self)
2133
end
2234
end
23-
24-
# == Schema Information
25-
#
26-
# Table name: highlights
27-
#
28-
# id :integer not null, primary key
29-
# user_id :integer
30-
# description :text
31-
# created_at :datetime
32-
# updated_at :datetime
33-
# featured :boolean default(FALSE)
34-
#

app/models/invitation.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
class Invitation < ActiveRecord::Base
2-
end
3-
41
# == Schema Information
52
#
63
# Table name: invitations
@@ -15,3 +12,6 @@ class Invitation < ActiveRecord::Base
1512
# updated_at :datetime
1613
# team_id :integer
1714
#
15+
16+
class Invitation < ActiveRecord::Base
17+
end

app/models/like.rb

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
# == Schema Information
2+
#
3+
# Table name: likes
4+
#
5+
# id :integer not null, primary key
6+
# value :integer
7+
# tracking_code :string(255)
8+
# user_id :integer
9+
# likable_id :integer
10+
# likable_type :string(255)
11+
# created_at :datetime
12+
# updated_at :datetime
13+
# ip_address :string(255)
14+
#
15+
116
class Like < ActiveRecord::Base
217

318
belongs_to :user
@@ -14,18 +29,3 @@ def liked_callback
1429
likable.try(:liked, value)
1530
end
1631
end
17-
18-
# == Schema Information
19-
#
20-
# Table name: likes
21-
#
22-
# id :integer not null, primary key
23-
# value :integer
24-
# tracking_code :string(255)
25-
# user_id :integer
26-
# likable_id :integer
27-
# likable_type :string(255)
28-
# created_at :datetime
29-
# updated_at :datetime
30-
# ip_address :string(255)
31-
#

0 commit comments

Comments
 (0)