Skip to content

Commit 53eb171

Browse files
authored
Merge pull request #1317 from Growstuff/dev
release 22
2 parents 39b461c + b0b6931 commit 53eb171

File tree

17 files changed

+99
-69
lines changed

17 files changed

+99
-69
lines changed

.haml-lint.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
linters:
22
LineLength:
33
max: 120
4+
InstanceVariables:
5+
enabled: false
6+
IdNames:
7+
enabled: false
8+
ConsecutiveComments:
9+
enabled: false

.mention-bot

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"userBlacklist": ["tygriffin","oshiho3"]
3+
}

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ group :development, :test do
122122
gem 'factory_girl_rails' # for creating test data
123123
gem 'haml-i18n-extractor'
124124
gem 'haml-rails' # HTML templating language
125-
gem 'haml_lint', '~> 0.20.0' # Checks haml files for goodness
125+
gem 'haml_lint' # Checks haml files for goodness
126126
gem 'i18n-tasks' # adds tests for finding missing and unused translations
127127
gem 'jasmine' # javascript unit testing
128128
gem 'poltergeist' # for headless JS testing

Gemfile.lock

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ GEM
2525
addressable
2626
active_merchant-paypal-bogus-gateway (0.1.0)
2727
activemerchant
28-
active_utils (3.3.1)
28+
active_utils (3.3.3)
2929
activesupport (>= 3.2, < 5.2.0)
3030
i18n
3131
activejob (4.2.8)
@@ -52,7 +52,7 @@ GEM
5252
public_suffix (~> 2.0, >= 2.0.2)
5353
arel (6.0.4)
5454
ast (2.3.0)
55-
autoprefixer-rails (6.7.7.1)
55+
autoprefixer-rails (6.7.7.2)
5656
execjs
5757
bcrypt (3.1.11)
5858
better_errors (2.1.1)
@@ -153,17 +153,17 @@ GEM
153153
json
154154
thread
155155
thread_safe
156-
elasticsearch (2.0.1)
157-
elasticsearch-api (= 2.0.1)
158-
elasticsearch-transport (= 2.0.1)
159-
elasticsearch-api (2.0.1)
156+
elasticsearch (2.0.2)
157+
elasticsearch-api (= 2.0.2)
158+
elasticsearch-transport (= 2.0.2)
159+
elasticsearch-api (2.0.2)
160160
multi_json
161161
elasticsearch-model (0.1.9)
162162
activesupport (> 3)
163163
elasticsearch (> 0.4)
164164
hashie
165165
elasticsearch-rails (0.1.9)
166-
elasticsearch-transport (2.0.1)
166+
elasticsearch-transport (2.0.2)
167167
faraday
168168
multi_json
169169
erubis (2.7.0)
@@ -189,8 +189,8 @@ GEM
189189
gibbon (1.2.1)
190190
httparty
191191
multi_json (>= 1.9.0)
192-
globalid (0.3.7)
193-
activesupport (>= 4.1.0)
192+
globalid (0.4.0)
193+
activesupport (>= 4.2.0)
194194
gravatar-ultimate (2.0.0)
195195
activesupport (>= 2.3.14)
196196
rack
@@ -222,8 +222,9 @@ GEM
222222
haml (>= 4.0.6, < 5.0)
223223
html2haml (>= 1.0.1)
224224
railties (>= 4.0.1)
225-
haml_lint (0.20.0)
226-
haml (~> 4.0)
225+
haml_lint (0.24.0)
226+
haml (>= 4.0, < 5.1)
227+
rainbow
227228
rake (>= 10, < 13)
228229
rubocop (>= 0.47.0)
229230
sysexits (~> 1.1)
@@ -265,7 +266,7 @@ GEM
265266
js-routes (1.3.3)
266267
railties (>= 3.2)
267268
sprockets-rails
268-
json (2.0.3)
269+
json (2.0.4)
269270
jwt (1.5.6)
270271
kaminari (0.17.0)
271272
actionpack (>= 3.0.0)
@@ -300,7 +301,7 @@ GEM
300301
multi_xml (0.6.0)
301302
multipart-post (2.0.0)
302303
nenv (0.3.0)
303-
newrelic_rpm (4.0.0.332)
304+
newrelic_rpm (4.1.0.333)
304305
nokogiri (1.7.1)
305306
mini_portile2 (~> 2.1.0)
306307
notiffany (0.1.1)
@@ -435,7 +436,7 @@ GEM
435436
ruby-progressbar (1.8.1)
436437
ruby-units (2.1.0)
437438
ruby_dep (1.5.0)
438-
ruby_parser (3.8.4)
439+
ruby_parser (3.9.0)
439440
sexp_processor (~> 4.1)
440441
rubyzip (1.2.1)
441442
sass (3.4.23)
@@ -449,7 +450,7 @@ GEM
449450
childprocess (~> 0.5)
450451
rubyzip (~> 1.0)
451452
websocket (~> 1.0)
452-
sexp_processor (4.8.0)
453+
sexp_processor (4.9.0)
453454
shellany (0.0.1)
454455
sidekiq (4.2.10)
455456
concurrent-ruby (~> 1.0)
@@ -472,7 +473,7 @@ GEM
472473
activesupport (>= 4.0)
473474
sprockets (>= 3.0.0)
474475
sysexits (1.2.0)
475-
term-ansicolor (1.5.0)
476+
term-ansicolor (1.6.0)
476477
tins (~> 1.0)
477478
terminal-table (1.7.3)
478479
unicode-display_width (~> 1.1.1)
@@ -488,7 +489,7 @@ GEM
488489
execjs (>= 0.3.0)
489490
json (>= 1.8.0)
490491
unicode-display_width (1.1.3)
491-
unicorn (5.2.0)
492+
unicorn (5.3.0)
492493
kgio (~> 2.6)
493494
raindrops (~> 0.7)
494495
uniform_notifier (1.10.0)
@@ -552,7 +553,7 @@ DEPENDENCIES
552553
haml
553554
haml-i18n-extractor
554555
haml-rails
555-
haml_lint (~> 0.20.0)
556+
haml_lint
556557
hashie (>= 3.5.3)
557558
heroku-api
558559
i18n-tasks

app/assets/stylesheets/overrides.sass

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,3 +333,6 @@ $state-success-bg: lighten($green, 50%)
333333
overflow: hidden
334334
text-overflow: ellipsis
335335
white-space: nowrap
336+
337+
ul.plantings
338+
list-style-type: none

app/helpers/gardens_helper.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,14 @@ def display_garden_plantings(plantings)
2121
if plantings.blank?
2222
"None"
2323
else
24-
output = ""
25-
plantings.first(2).each do |planting|
24+
output = '<ul class="plantings">'
25+
plantings.each do |planting|
2626
output += "<li>"
2727
output += planting.quantity.nil? ? "0 " : "#{planting.quantity} "
2828
output += link_to planting.crop.name, planting.crop
2929
output += ", planted on #{planting.planted_at}</li>"
3030
end
31+
output += '</ul>'
3132
output.html_safe
3233
end
3334
end

app/models/garden.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ class Garden < ActiveRecord::Base
44
include PhotoCapable
55
friendly_id :garden_slug, use: [:slugged, :finders]
66

7-
belongs_to :owner, class_name: 'Member', foreign_key: 'owner_id'
7+
belongs_to :owner, class_name: 'Member', foreign_key: 'owner_id', counter_cache: true
88
has_many :plantings, -> { order(created_at: :desc) }, dependent: :destroy
99
has_many :crops, through: :plantings
1010

app/models/harvest.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class Harvest < ActiveRecord::Base
55
friendly_id :harvest_slug, use: [:slugged, :finders]
66

77
belongs_to :crop
8-
belongs_to :owner, class_name: 'Member'
8+
belongs_to :owner, class_name: 'Member', counter_cache: true
99
belongs_to :plant_part
1010
belongs_to :planting
1111

app/models/member.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class Member < ActiveRecord::Base
4343
.has_plantings
4444
}
4545

46-
scope :has_plantings, -> { joins(:plantings).where("plantings.id IS NOT NULL") }
46+
scope :has_plantings, -> { joins(:plantings).group("members.id") }
4747

4848
has_many :follows, class_name: "Follow", foreign_key: "follower_id"
4949
has_many :followed, through: :follows

app/models/seed.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ class Seed < ActiveRecord::Base
44
friendly_id :seed_slug, use: [:slugged, :finders]
55

66
belongs_to :crop
7-
belongs_to :owner, class_name: 'Member', foreign_key: 'owner_id'
7+
belongs_to :owner, class_name: 'Member', foreign_key: 'owner_id', counter_cache: true
88

99
default_scope { order("created_at desc") }
1010

0 commit comments

Comments
 (0)