Skip to content

Commit f43eaec

Browse files
committed
WIP: Removing MongoDB models
1 parent 082234d commit f43eaec

File tree

101 files changed

+1235
-309
lines changed

Some content is hidden

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

101 files changed

+1235
-309
lines changed

Gemfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ gem 'tire'
144144

145145
group :development do
146146
gem 'better_errors'
147+
gem 'binding_of_caller'
147148
gem 'flog'
148149
gem 'fukuzatsu'
149150
gem 'guard-rspec'
@@ -155,16 +156,17 @@ group :development do
155156
end
156157

157158
group :development, :test do
159+
gem 'annotate'
158160
gem 'fabrication-rails'
159161
gem 'ffaker'
160162
gem 'jazz_hands', github: 'nixme/jazz_hands', branch: 'bring-your-own-debugger'
161163
gem 'launchy'
162164
gem 'pry-byebug'
163165
gem 'pry-rescue'
166+
gem 'pry-stack_explorer'
164167
gem 'quiet_assets'
165-
gem 'syntax'
166-
gem 'annotate'
167168
gem 'rspec-rails'
169+
gem 'syntax'
168170
end
169171

170172
group :test do

Gemfile.lock

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,7 @@ DEPENDENCIES
744744
awesome_print
745745
backbone-on-rails
746746
better_errors
747+
binding_of_caller
747748
bson_ext
748749
capybara
749750
capybara-screenshot
@@ -809,6 +810,7 @@ DEPENDENCIES
809810
postgres_ext
810811
pry-byebug
811812
pry-rescue
813+
pry-stack_explorer
812814
pubnub (= 0.1.9)
813815
puma
814816
querystring

app/controllers/accounts_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def ensure_account_admin
7979
end
8080

8181
def determine_plan
82-
chosen_plan = params[:account].delete(:chosen_plan)
82+
chosen_plan = params[:teams_account].delete(:chosen_plan)
8383
@plan = Plan.find_by_public_id(chosen_plan)
8484
end
8585

app/controllers/teams_controller.rb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ def create
8080
create_params = params.require(:team).permit(:selected, :slug, :name)
8181

8282
@team, confirmed = selected_or_new(create_params)
83-
@teams = Team.any_of({ :name => /#{team_to_regex(@team)}.*/i }).limit(3).to_a unless confirmed
83+
#@teams = Team.any_of({ :name => /#{team_to_regex(@team)}.*/i }).limit(3).to_a unless confirmed
84+
@teams = Team.where('name ilike ?', "#{@team}%").limit(3) unless confirmed
8485

8586
if @team.valid? and @teams.blank? and @team.new_record?
8687
@team.add_user(current_user)
@@ -90,6 +91,10 @@ def create
9091
end
9192
end
9293

94+
#def team_to_regex(team)
95+
#team.name.gsub(/ \-\./, '.*')
96+
#end
97+
9398
def edit
9499
edit_params = params.permit(:slug, :id)
95100

@@ -299,10 +304,6 @@ def previous_job(job)
299304
Opportunity.with_public_id(public_id) unless public_id.nil?
300305
end
301306

302-
def team_to_regex(team)
303-
team.name.gsub(/ \-\./, '.*')
304-
end
305-
306307
def selected_or_new(opts)
307308
team = Team.new(name: opts[:name])
308309
confirm = false

app/controllers/usernames_controller.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
class UsernamesController < ApplicationController
22
skip_before_action :require_registration
33

4+
# TODO: Clean up the config/routes for /usernames
5+
# There is no UsernamesController#index for example. Why is there a route?
6+
47
def show
58
# allow validation to pass if it's the user's username that they're trying to validate (for edit username)
69
if signed_in? && current_user.username.downcase == params[:id].downcase
@@ -11,4 +14,4 @@ def show
1114
head :ok
1215
end
1316
end
14-
end
17+
end

app/helpers/teams_helper.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def team_job_path(team)
155155
teamname_path(slug: team.slug) + "#open-positions"
156156
end
157157

158-
def edit_team_locations_path(team)
158+
def edit_s_path(team)
159159
teamname_path(slug: team.slug) + "/edit/#locations"
160160
end
161161

@@ -194,4 +194,4 @@ def team_twitter_link(team)
194194
end
195195

196196

197-
end
197+
end

app/models/api_access.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def can_award?(badge_name)
1313
end
1414

1515
# == Schema Information
16-
# Schema version: 20140728214411
16+
# Schema version: 20140918031936
1717
#
1818
# Table name: api_accesses
1919
#

app/models/available_coupon.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ class AvailableCoupon < ActiveRecord::Base
22
end
33

44
# == Schema Information
5-
# Schema version: 20140728214411
5+
# Schema version: 20140918031936
66
#
77
# Table name: available_coupons
88
#

app/models/badge.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def event_type
9898
end
9999

100100
# == Schema Information
101-
# Schema version: 20140728214411
101+
# Schema version: 20140918031936
102102
#
103103
# Table name: badges
104104
#

app/models/comment.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def analyze_spam
138138
end
139139

140140
# == Schema Information
141-
# Schema version: 20140728214411
141+
# Schema version: 20140918031936
142142
#
143143
# Table name: comments
144144
#

0 commit comments

Comments
 (0)