Skip to content

Commit

Permalink
Merge branch 'dev' into awesomecode-style/andor-8234
Browse files Browse the repository at this point in the history
  • Loading branch information
Br3nda committed Feb 10, 2018
2 parents 33fb240 + 1a9ff5e commit 978523f
Show file tree
Hide file tree
Showing 380 changed files with 2,834 additions and 5,658 deletions.
22 changes: 1 addition & 21 deletions .rubocop_todo.yml
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config --no-offense-counts`
# on 2017-12-06 11:20:15 +1300 using RuboCop version 0.49.1.
# on 2018-02-05 14:37:22 +1300 using RuboCop version 0.49.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand Down Expand Up @@ -39,7 +39,6 @@ Rails/SkipsModelValidations:
# SupportedStyles: strict, flexible
Rails/TimeZone:
Exclude:
- 'spec/controllers/accounts_controller_spec.rb'
- 'spec/factories/member.rb'
- 'spec/factories/post.rb'
- 'spec/models/post_spec.rb'
Expand All @@ -60,32 +59,18 @@ Style/AsciiComments:
# SupportedStyles: nested, compact
Style/ClassAndModuleChildren:
Exclude:
- 'app/controllers/admin/orders_controller.rb'
- 'lib/actions/oauth_signup_action.rb'
- 'lib/haml/filters/escaped_markdown.rb'

Style/IdenticalConditionalBranches:
Exclude:
- 'app/controllers/follows_controller.rb'

# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: line_count_dependent, lambda, literal
Style/Lambda:
Exclude:
- 'spec/controllers/member_controller_spec.rb'
- 'spec/models/photo_spec.rb'

# Cop supports --auto-correct.
Style/MultilineIfModifier:
Exclude:
- 'spec/rails_helper.rb'

# Cop supports --auto-correct.
Style/MutableConstant:
Exclude:
- 'app/models/planting.rb'

# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, EnforcedStyle, SupportedStyles.
# SupportedStyles: predicate, comparison
Expand All @@ -96,11 +81,6 @@ Style/NumericPredicate:
- 'app/helpers/plantings_helper.rb'
- 'lib/tasks/growstuff.rake'

# Cop supports --auto-correct.
Style/ParallelAssignment:
Exclude:
- 'app/mailers/notifier.rb'

# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, AllowInnerSlashes.
# SupportedStyles: slashes, percent_r, mixed
Expand Down
14 changes: 6 additions & 8 deletions Gemfile
Expand Up @@ -48,7 +48,6 @@ gem 'bootstrap-kaminari-views' # bootstrap views for kaminari
gem 'kaminari' # pagination

gem 'active_utils'
gem 'activemerchant'
gem 'sidekiq'

# Markdown formatting for updates etc
Expand Down Expand Up @@ -78,7 +77,7 @@ gem 'omniauth-facebook'
gem 'omniauth-flickr', '>= 0.0.15'
gem 'omniauth-twitter'

gem 'chartkick'
gem "chartkick"

# client for Elasticsearch. Elasticsearch is a flexible
# and powerful, distributed, real-time search and analytics engine.
Expand All @@ -87,15 +86,15 @@ gem 'chartkick'
# Project does not use semver, so we want to be in sync with the version of
# elasticsearch we use
# See https://github.com/elastic/elasticsearch-ruby#compatibility
gem 'elasticsearch-api', '~> 2.0.0'
gem 'elasticsearch-model'
gem 'elasticsearch-rails'
gem 'hashie', '>= 3.5.3'
gem "elasticsearch-api", "~> 2.0.0"
gem "elasticsearch-model"
gem "elasticsearch-rails"
gem "hashie", ">= 3.5.3"

gem 'rake', '>= 10.0.0'

# locale based flash notices for controllers
gem 'responders'
gem "responders"

# allows soft delete. Used for members.
gem 'acts_as_paranoid', '~> 0.5.0'
Expand Down Expand Up @@ -125,7 +124,6 @@ group :development do
end

group :development, :test do
gem 'active_merchant-paypal-bogus-gateway'
gem 'bullet' # performance tuning by finding unnecesary queries
gem 'byebug' # debugging
gem 'capybara' # integration tests
Expand Down
10 changes: 0 additions & 10 deletions Gemfile.lock
Expand Up @@ -26,19 +26,12 @@ GEM
addressable
active_median (0.1.4)
activerecord
active_merchant-paypal-bogus-gateway (0.1.0)
activemerchant
active_utils (3.3.9)
activesupport (>= 3.2, < 5.2.0)
i18n
activejob (4.2.10)
activesupport (= 4.2.10)
globalid (>= 0.3.0)
activemerchant (1.77.0)
activesupport (>= 3.2.14, < 6.x)
builder (>= 2.1.2, < 4.0.0)
i18n (>= 0.6.9)
nokogiri (~> 1.4)
activemodel (4.2.10)
activesupport (= 4.2.10)
builder (~> 3.1)
Expand Down Expand Up @@ -549,9 +542,7 @@ PLATFORMS

DEPENDENCIES
active_median
active_merchant-paypal-bogus-gateway
active_utils
activemerchant
acts_as_paranoid (~> 0.5.0)
better_errors (~> 2.2.0)
binding_of_caller
Expand Down Expand Up @@ -636,7 +627,6 @@ DEPENDENCIES
will_paginate
xmlrpc


RUBY VERSION
ruby 2.4.1p111

Expand Down
6 changes: 3 additions & 3 deletions Guardfile
Expand Up @@ -3,11 +3,11 @@ guard :rspec,
failed_mode: :keep do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/libs/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { 'spec' }
watch('spec/spec_helper.rb') { "spec" }

# Rails example
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
watch(%r{^app/(.*)(\.erb|\.haml|\.slim)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
watch(%r{^spec/support/(.+)\.rb$}) { 'spec' }
watch('config/routes.rb') { 'spec/routing' }
watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
watch('config/routes.rb') { "spec/routing" }
end
53 changes: 0 additions & 53 deletions app/controllers/account_types_controller.rb

This file was deleted.

31 changes: 0 additions & 31 deletions app/controllers/accounts_controller.rb

This file was deleted.

23 changes: 0 additions & 23 deletions app/controllers/admin/orders_controller.rb

This file was deleted.

4 changes: 2 additions & 2 deletions app/controllers/alternate_names_controller.rb
Expand Up @@ -30,7 +30,7 @@ def create
if @alternate_name.save
redirect_to @alternate_name.crop, notice: 'Alternate name was successfully created.'
else
render action: 'new'
render action: "new"
end
end

Expand All @@ -40,7 +40,7 @@ def update
if @alternate_name.update(alternate_name_params)
redirect_to @alternate_name.crop, notice: 'Alternate name was successfully updated.'
else
render action: 'edit'
render action: "edit"
end
end

Expand Down
14 changes: 7 additions & 7 deletions app/controllers/application_controller.rb
Expand Up @@ -7,12 +7,12 @@ class ApplicationController < ActionController::Base
before_action :set_locale

def store_location
unless request.path.in?(['/members/sign_in',
'/members/sign_up',
'/members/password/new',
'/members/password/edit',
'/members/confirmation',
'/members/sign_out']) || request.xhr?
unless request.path.in?(["/members/sign_in",
"/members/sign_up",
"/members/password/new",
"/members/password/edit",
"/members/confirmation",
"/members/sign_out"]) || request.xhr?
store_location_for(:member, request.fullpath)
end
end
Expand Down Expand Up @@ -77,6 +77,6 @@ def configure_permitted_parameters
end

def expire_homepage
expire_fragment('homepage_stats')
expire_fragment("homepage_stats")
end
end
4 changes: 2 additions & 2 deletions app/controllers/authentications_controller.rb
Expand Up @@ -22,9 +22,9 @@ def create
name: name
)

flash[:notice] = 'Authentication successful.'
flash[:notice] = "Authentication successful."
else
flash[:notice] = 'Authentication failed.'
flash[:notice] = "Authentication failed."
end
redirect_to request.env['omniauth.origin'] || edit_member_registration_path
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/charts/crops_controller.rb
Expand Up @@ -14,7 +14,7 @@ def harvested_for
@crop = Crop.find(params[:crop_id])
render json: Harvest.joins(:plant_part)
.where(crop: @crop)
.group('plant_parts.name').count(:id)
.group("plant_parts.name").count(:id)
end

private
Expand Down
16 changes: 8 additions & 8 deletions app/controllers/crops_controller.rb
Expand Up @@ -23,9 +23,9 @@ def requested
def wrangle
@approval_status = params[:approval_status]
@crops = case @approval_status
when 'pending'
when "pending"
Crop.pending_approval
when 'rejected'
when "rejected"
Crop.rejected
else
Crop.recent
Expand Down Expand Up @@ -78,7 +78,7 @@ def create
@crop.creator = current_member
else
@crop.requester = current_member
@crop.approval_status = 'pending'
@crop.approval_status = "pending"
end

notify_wranglers if Crop.transaction { @crop.save && save_crop_names }
Expand All @@ -89,13 +89,13 @@ def create
def update
previous_status = @crop.approval_status

@crop.creator = current_member if previous_status == 'pending'
@crop.creator = current_member if previous_status == "pending"

if @crop.update(crop_params)
recreate_names('alt_name', 'alternate')
recreate_names('sci_name', 'scientific')

notifier.deliver_now! if previous_status == 'pending'
notifier.deliver_now! if previous_status == "pending"
end

respond_with @crop
Expand All @@ -110,9 +110,9 @@ def destroy

def notifier
case @crop.approval_status
when 'approved'
when "approved"
Notifier.crop_request_approved(@crop.requester, @crop)
when 'rejected'
when "rejected"
Notifier.crop_request_rejected(@crop.requester, @crop)
end
end
Expand Down Expand Up @@ -185,7 +185,7 @@ def crop_json_fields
def crops
q = Crop.approved.includes(:scientific_names, plantings: :photos)
q = q.popular unless @sort == 'alpha'
q.order('LOWER(crops.name)').includes(:photos).paginate(page: params[:page])
q.order("LOWER(crops.name)").includes(:photos).paginate(page: params[:page])
end

def requested_crops
Expand Down

0 comments on commit 978523f

Please sign in to comment.