Commit Graph
78 Commits
Author SHA1 Message Date
Miles Gould 6be9640625 Run tests with rake when DB does not yet exist
Previously, `rake spec` ran the tests whether or not the `growstuff_test`
database existed or not, but `rake` crashed unless it had already been
created. The problem was that `rake` was trying to load the environment,
which required the presence of a DB; `rake spec` was running this with
the `dev` environment, so succeeded if `growstuff_dev` existed, but
`rake` was running everything with the `test` environment, so would fail
if `growstuff_test` did not exist.

This patch adds `db:create` to the dependencies of the `spec` task,
forcing an unadorned `rake` to create all necessary databases first.
2016-11-30 11:35:35 +00:00
Brenda Wallace 62e7c716dd Removed extra empty blank lines 2016-11-26 12:06:02 +13:00
Brenda Wallace c878baa886 Indented parameters cleanup 2016-11-26 11:41:07 +13:00
Brenda Wallace 83392ddda1 Indentation clean ups 2016-11-26 10:51:54 +13:00
Brenda Wallace be67b858b4 Merge remote-tracking branch 'upstream/dev' into bw/long-lines-fixed
Conflicts:
	lib/tasks/growstuff.rake
2016-11-25 08:18:18 +13:00
Brenda Wallace 18a8d6c5bf Re-instate usage info when args not as expected 2016-11-23 20:38:46 +13:00
Brenda Wallace 37d01e831f Reduced code duplication in growstuff.rake 2016-11-23 20:27:20 +13:00
Brenda Wallace 2872a1c29d Wrapped all long lines.
reduced rubocop's line length limit to 120
2016-11-17 22:02:18 +13:00
Brenda Wallace bdb057ca0f Removed all trailing white space 2016-11-14 15:05:32 +13:00
Daniel O'Connor 5d70d822eb #951 Swap to deliver_later implementation 2016-08-16 10:55:40 +09:30
Daniel O'Connor 7fe75ee52a Fix DEPRECATION WARNING: #deliver is deprecated. 2016-06-10 15:45:01 +09:30
Daniel O'Connor 4b4e0cf69a $ rubocop --only HashSyntax --auto-correct
483 files inspected, 2018 offenses detected, 2018 offenses corrected
2016-05-19 15:53:11 -04:00
Mackenzie Morgan 87bfceb035 make the one-off save the si weight 2015-02-02 23:49:07 -05:00
Mackenzie Morgan 7ca89908cd merge from upstream 2015-02-01 22:00:52 -05:00
Mackenzie Morgan 2c94f61843 use %0.3f instead of %0.2f so we get to gram-granularity, and don't duplicate code 2015-02-01 21:59:33 -05:00
Mackenzie Morgan de5b16e384 back to kg for si weight, also now adding si_weight to the csv correctly 2015-01-31 18:35:29 -05:00
Mackenzie Morgan bb9695b272 add check for nil to set_si_weights and the corresponding deploy script and update test 2015-01-31 00:45:31 -05:00
Mackenzie Morgan d436fd86f8 use ruby-units to handle conversion. note: the deploy task isn't working and i don't know why 2015-01-31 00:22:35 -05:00
Mackenzie Morgan 2567e7cd74 adding tests (not passing, need to figure out saving mid-test), fixing before_save, adding CSV column, and adding task to set the si_weight throughout the db 2015-01-29 00:27:53 -05:00
Mackenzie Morgan 0bdab0d9fc basics of harvest standardized weights 2015-01-28 23:00:16 -05:00
Shiho Takagi 04d61bd040 deployment sript 2015-01-25 16:18:26 +11:00
Shiho Takagi 5a96b7efd6 adding a rake task to generate elasticsearch index 2015-01-25 15:47:40 +11:00
Taylor Griffin a35a573b2b update follow member code to be rails 4 compatible 2014-12-14 14:51:18 +11:00
Miles Gould 9f54641e95 Find crops by name when loading altnames
Crop IDs are not guaranteed to be the same on staging and production.
2014-12-01 11:03:27 +00:00
Miles Gould 4b90f6385b Merge branch 'dev' into load_alternate_names
Conflicts:
	Gemfile.lock
	script/deploy-tasks.sh
2014-12-01 10:47:10 +00:00
Taylor Griffin 8e79199766 wip: upgrading rspec 2014-11-15 22:55:37 +11:00
Skud 267c671259 cweek not cw_week 2014-11-11 20:55:04 +11:00
Skud eb98910bea Only send planting reminders to confirmed accounts 2014-11-11 19:45:07 +11:00
Miles Gould badb0c4fe7 Make load altnames task idempotent. 2014-10-19 22:21:29 +01:00
Miles Gould 06a4fcab71 Remove superfluous* error-checks from load_altnames
* /me crosses fingers...
2014-10-19 22:19:41 +01:00
Miles Gould 36be5e9533 Hardcode alternate-name CSV file path. 2014-10-19 21:54:46 +01:00
Miles Gould 0aea1721d8 Add altname data and include load in deploy-tasks. 2014-10-19 17:24:18 +01:00
Miles Gould 3d10553373 Add Rake task to load altnames. 2014-10-19 17:24:18 +01:00
Skud e4cf636bef Merge branch 'dev' of https://github.com/Growstuff/growstuff into plantingreminder
Conflicts:
	app/models/harvest.rb
	db/schema.rb
	spec/models/harvest_spec.rb
2014-10-15 14:20:16 +01:00
Shiho Takagi cf07ecfa4a improved test spec, crop page and added rake task 2014-10-05 23:16:46 +11:00
Shiho Takagi 6e02f40e0a merging from dev 2014-10-05 13:47:12 +11:00
Shiho Takagi 14d039ee01 Added crops-posts association as well as updated GUI for crop show 2014-10-05 13:32:08 +11:00
Skud a5b856b506 Merge pull request #410 from maco/dev
Harvest photos
2014-10-02 17:45:59 +10:00
Skud 8497782847 Clear crop hierarchy view cache after uploading crops
The crop_sweeper only acts in response to things that happen in the
controller.  Since this works directly with the model, we need to clear
the cache fragment manually.
2014-09-30 23:02:09 +10:00
Skud 98da785d8a Removed spurious debugging puts 2014-09-30 22:37:58 +10:00
Skud 65c46c334b Delete unused photos
Make sure the models are setup so that if a photo is not used for
anything, it's removed from the system.

Also wrote a rake task (which should be run on deploy) to remove older
unused photos.
2014-09-29 09:18:28 +10:00
Skud 529c98f5dc Move actual sending of planting reminder to rake task 2014-09-28 15:28:53 +10:00
Mackenzie Morgan f3c3d73ef1 updating test for harvest units to list the valid units and adding a task to correct misspelled pint harvests already in the database 2014-08-10 19:49:10 -04:00
Skud 8223025d35 Set default plantings_count to 0 not nil 2014-07-18 18:06:43 +10:00
Skud 5744499182 Added rake task to add new crop wranglers
Also changed code for admin and crop wrangler to assume we already have
those roles set up, as they're part of db/seeds.rb
2014-07-06 20:37:54 +10:00
Miles Gould f723fea4e2 Load plant parts in db:seed and rake task. 2013-10-30 23:49:34 +00:00
Skud b63c854b16 Set default garden locations
Also created a handy rake task to depopulate Null Island (i.e. fix up
anyone's lat/long that's somehow ended up as 0,0).
2013-10-25 23:45:48 +11:00
Skud c46e19e43e Load multiple crop CSV files from seeds.rb
We factored out a Crop.create_from_csv method to avoid duplicated code.

Note: naming convention with db/seeds/crop*.csv is to use a 2-digit
number for ordering.  00 and 10 chosen (with a gap in between) because I
learned to program in BASIC and it seemed like a good idea just in case.
2013-10-17 22:45:09 +11:00
Skud a98cb31161 Added rake task to import new crops from CSV 2013-10-17 22:08:54 +11:00
Miles Gould b30ea755e0 Merge branch 'planting-owner' into dev
Conflicts:
	script/deploy-tasks.sh
2013-08-27 16:35:32 +01:00