Compare commits

...

15 Commits

Author SHA1 Message Date
Brenda Wallace
8c51d7bdd5 Merge branch 'master' into dev 2018-02-18 13:09:56 +13:00
Cesy
64e3b3b4d4 Merge pull request #1565 from Growstuff/awesomecode-style/andor-8234
Auto corrected by following Style/AndOr
2018-02-16 08:47:02 +00:00
Brenda Wallace
978523fd94 Merge branch 'dev' into awesomecode-style/andor-8234 2018-02-11 08:50:50 +13:00
Brenda Wallace
97f63d1147 Merge pull request #1583 from Growstuff/dev
Production hotfix
2018-02-11 08:42:49 +13:00
Brenda Wallace
1a9ff5eb4c Merge branch 'master' into dev 2018-02-11 08:14:44 +13:00
Brenda Wallace
72b1494db9 Merge pull request #1582 from Br3nda/hotfix-migration
Don't update flickr photos in migration
2018-02-11 08:14:00 +13:00
Brenda Wallace
83bba916a4 Don't update flickr photos in migration 2018-02-10 18:41:11 +13:00
Brenda Wallace
64179850ff Merge pull request #1563 from Growstuff/dev
Release 40
2018-02-10 09:04:55 +13:00
Brenda Wallace
33fb2408d6 Merge branch 'dev' into awesomecode-style/andor-8234 2018-02-07 14:25:41 +13:00
Brenda Wallace
ef4b4d0c46 Merge branch 'dev' into awesomecode-style/andor-8234 2018-02-07 08:41:30 +13:00
Brenda Wallace
0b5c45d08f Merge branch 'dev' into awesomecode-style/andor-8234 2018-02-05 16:13:15 +13:00
Brenda Wallace
57bfafccc7 Merge branch 'dev' into awesomecode-style/andor-8234 2018-02-05 12:28:08 +13:00
Daniel O'Connor
2f3e368ede Merge branch 'dev' into awesomecode-style/andor-8234 2018-01-29 11:45:51 +10:30
Shiny
3d4598e4e1 style clean up 2018-01-29 12:56:41 +13:00
Awesome Code
94db28b3a9 Auto corrected by following Style/AndOr 2018-01-28 23:47:38 +00:00
2 changed files with 4 additions and 19 deletions

View File

@@ -1,20 +1,5 @@
class AddDatetakenToPhotos < ActiveRecord::Migration
def up
def change
add_column :photos, :date_taken, :datetime
update_flickr_metadata
end
def down
add_column :photos, :date_taken
end
private
def update_flickr_metadata
# Fetch from flickr, the photos updated the longest ago will be fetched first
Photo.all.order(:updated_at).each do |photo|
say "Fetch flickr data for #{photo}"
photo.set_flickr_metadata!
end
end
end

View File

@@ -51,7 +51,7 @@ namespace :growstuff do
send_on_day = 3 # wednesday
every_n_weeks = 2 # send fortnightly
if Time.zone.today.cwday == send_on_day and Time.zone.today.cweek % every_n_weeks == 0
if (Time.zone.today.cwday == send_on_day) && (Time.zone.today.cweek % every_n_weeks == 0)
Member.confirmed.find_each do |m|
Notifier.planting_reminder(m).deliver_now!
end
@@ -62,7 +62,7 @@ namespace :growstuff do
# this fixes up anyone who has erroneously wound up with a 0,0 lat/long
task depopulate_null_island: :environment do
Member.find_each do |m|
if m.location and (m.latitude.nil? and m.longitude.nil?)
if m.location && (m.latitude.nil? && m.longitude.nil?)
m.geocode
m.save
end
@@ -88,7 +88,7 @@ namespace :growstuff do
# site is small and there aren't many of them, so it shouldn't matter
# for this one-off script.
Garden.all.each do |g|
if g.name.nil? or g.name =~ /^\s*$/
if g.name.nil? || g.name =~ /^\s*$/
g.name = "Garden"
g.save
end