mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-03-29 04:02:17 -04:00
6
Gemfile
6
Gemfile
@@ -187,18 +187,16 @@ end
|
||||
group :test do
|
||||
gem 'axe-core-capybara'
|
||||
gem 'axe-core-rspec'
|
||||
gem "percy-capybara", "~> 5.0.0"
|
||||
gem 'rails-controller-testing'
|
||||
gem "rspec-rebound"
|
||||
gem 'selenium-webdriver'
|
||||
gem 'timecop'
|
||||
gem 'vcr'
|
||||
gem "rspec-rebound"
|
||||
gem "percy-capybara", "~> 5.0.0"
|
||||
end
|
||||
|
||||
group :travis do
|
||||
gem 'platform-api'
|
||||
end
|
||||
|
||||
|
||||
|
||||
gem "i18n_data", "~> 1.1"
|
||||
|
||||
@@ -43,6 +43,6 @@ module OpenFarmData
|
||||
def fetch_attr(key)
|
||||
return if openfarm_data.blank?
|
||||
|
||||
openfarm_data.fetch('attributes', {}).fetch(key, nil)
|
||||
openfarm_data.dig('attributes', key)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -90,7 +90,7 @@ class Crop < ApplicationRecord
|
||||
def popular_plant_parts
|
||||
PlantPart.joins(:harvests)
|
||||
.where("crop_id = ?", id)
|
||||
.order("count_harvests_id DESC")
|
||||
.order(count_harvests_id: :desc)
|
||||
.group("plant_parts.id", "plant_parts.name")
|
||||
.count("harvests.id")
|
||||
end
|
||||
|
||||
@@ -47,7 +47,7 @@ class Photo < ApplicationRecord
|
||||
info = flickr.photos.getInfo(photo_id: source_id)
|
||||
licenses = flickr.photos.licenses.getInfo
|
||||
license = licenses.find { |l| l.id.to_i == info.license.to_i }
|
||||
Rails.logger.error("Cannot find license: " + [info.license, licenses].inspect) unless license
|
||||
Rails.logger.error("Cannot find license: #{[info.license, licenses].inspect}") unless license
|
||||
{
|
||||
title: calculate_title(info),
|
||||
license_name: license.name,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class UnauthorisedError < JSONAPI::Error
|
||||
end
|
||||
JSONAPI.configure do |config|
|
||||
|
||||
@@ -5,7 +5,7 @@ Mailboxer.setup do |config|
|
||||
config.uses_emails = true
|
||||
|
||||
# Configures the default from for emails sent for Messages and Notifications
|
||||
config.default_from = "Growstuff <#{ENV.fetch('GROWSTUFF_EMAIL', "no-reply@growstuff.org")}>"
|
||||
config.default_from = "Growstuff <#{ENV.fetch('GROWSTUFF_EMAIL', 'no-reply@growstuff.org')}>"
|
||||
|
||||
# Configures the methods needed by mailboxer
|
||||
# config.email_method = :email
|
||||
|
||||
@@ -4,11 +4,11 @@ class PopulateCropFieldsFromOpenfarmData < ActiveRecord::Migration[5.2]
|
||||
if crop.openfarm_data.present?
|
||||
attributes = crop.openfarm_data.fetch('attributes', {})
|
||||
crop.update_columns(
|
||||
row_spacing: attributes['row_spacing'],
|
||||
spread: attributes['spread'],
|
||||
height: attributes['height'],
|
||||
sowing_method: attributes['sowing_method'],
|
||||
sun_requirements: attributes['sun_requirements'],
|
||||
row_spacing: attributes['row_spacing'],
|
||||
spread: attributes['spread'],
|
||||
height: attributes['height'],
|
||||
sowing_method: attributes['sowing_method'],
|
||||
sun_requirements: attributes['sun_requirements'],
|
||||
growing_degree_days: attributes['growing_degree_days']
|
||||
)
|
||||
end
|
||||
|
||||
@@ -4,7 +4,7 @@ class CreateGardenCollaborators < ActiveRecord::Migration[7.2]
|
||||
t.references :member
|
||||
t.references :garden
|
||||
t.timestamps
|
||||
t.index [:member_id, :garden_id], unique: true
|
||||
t.index %i(member_id garden_id), unique: true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user