Commit Graph

356 Commits

Author SHA1 Message Date
Skud
1d81064ced removed unused Crop.random method 2014-10-15 14:03:00 +01:00
Skud
25cb3fd469 Fixed scientific name upload bug and wrote tests
Wrote unit tests and refactored Crop.create_from_csv

The actual bug (now fixed) is that if you didn't specify a SN in the
CSV, it would try and pick it up from the parent crop, but then the
testing for "is this a dup?" was based on what was in the CSV and didn't
take that parent SN into account.  This is now fixed.
2014-10-15 13:58:21 +01:00
Skud
374987488f Fixed broken tests. 2014-09-12 08:30:44 +10:00
Skud
85b5ac12ca added validation for finished_at (must be after planted_at) 2014-09-12 07:50:25 +10:00
Skud
af2d0e22ee Automatically set plantings to finished when a garden is marked inactive 2014-08-30 10:51:33 +10:00
Skud
e7dd50c3f1 Added scopes for finished and current plantings 2014-08-30 09:28:02 +10:00
Skud
b07d9d8db0 Added finished fields for plantings 2014-08-30 09:27:41 +10:00
Taylor Griffin
6bb74039a7 fix slug bug 2014-08-29 07:31:02 +10:00
Taylor Griffin
2c50c3b703 merge in a bunch of (mostly bootstrap 3) changes 2014-08-29 07:14:44 +10:00
Taylor Griffin
550cb4b265 put validation in the correct place this time 2014-08-29 06:56:02 +10:00
Taylor Griffin
62e1c3bb93 add server side validation 2014-08-29 06:45:37 +10:00
Marlena Compton
36199054c0 changed method so that you can now call crop_wranglers and admins. meta-programming ftw 2014-08-21 20:11:10 -07:00
Marlena Compton
ec25f2ab91 created list of crop wranglers on the crop wranglers page 2014-08-21 20:11:10 -07:00
Taylor Griffin
8352807d5a add presence validation for crop association on harvest 2014-08-01 19:27:51 +10:00
Mackenzie Morgan
d17ab658c8 fix typo. pint was ping 2014-07-30 09:28:08 -04:00
Mackenzie Morgan
1716de2dfc Add 'oz' as a weight unit for harvesting 2014-07-30 01:31:39 -04:00
Taylor Griffin
012f37f366 set autoFocus to true for jquery autocomplete 2014-07-29 08:42:35 +10:00
Skud
d558353e4c Merge branch 'scinames' of github.com:Skud/growstuff into Skud-scinames
Conflicts:
	CONTRIBUTORS.md
2014-07-22 11:23:08 +10:00
Skud
aeb14021f3 Removed unpopular scope (guess it really was unpopular) 2014-07-18 18:17:37 +10:00
Skud
8223025d35 Set default plantings_count to 0 not nil 2014-07-18 18:06:43 +10:00
Skud
573e555bcf Added unpopular scope to crop 2014-07-18 17:52:11 +10:00
Skud
c9857bf1c8 popular scope for crops 2014-07-18 17:38:15 +10:00
Taylor Griffin
8b45a1759c got scientific names working on the crop page but view tests are failing 2014-07-13 17:57:55 +10:00
Skud
7d624fd9ca Attempting to get scientific name editing on one page (doesn't work yet) 2014-07-06 21:21:51 +10:00
Skud
77d2b0e950 make crop search case insensitive 2014-07-06 20:16:59 +10:00
Skud
0560172565 Fixed incorrect env variable 2014-06-28 11:28:21 -07:00
Skud
1d71afdb2f Added roots/tubers to the CSV output
Also rearranged their order on the planting form to put it nearer bulbs
2014-05-30 11:05:33 -05:00
Mackenzie Morgan
062add32dc Add 'root/tuber' to 'planted from:' list, for things like potatoes 2014-05-04 22:46:45 -04:00
Skud
b61bbc2170 moved mailchimp settings to figaro 2014-04-29 13:11:57 +10:00
Skud
1c34d428f2 Merge branch 'crop-search' of https://github.com/Skud/growstuff into Skud-crop-search
Conflicts:
	spec/models/crop_spec.rb
2014-04-29 11:16:20 +10:00
Skud
b86014b04f attempting to fix libv8 problem occurring on heroku 2014-04-28 13:02:23 +10:00
Miles Gould
79f96f5ef4 Insist that crops created by db:seed are new.
This shaves 2s off the 22s runtime of `rake db:seed` on my machine.
2014-01-10 18:11:27 +00:00
Skud
addd9cbddf Added search method to crops
For now it just does a naive SQL LIKE query. We can make this fancier in
future, if we want to.
2014-01-03 21:50:41 +11:00
Miles Gould
338a7512e8 Explain reordering of plant_parts in a comment. 2014-01-02 11:04:57 +00:00
Miles Gould
18ccb0d9fb Merge branch 'dev' into harvest-parts
Conflicts:
	spec/models/harvest_spec.rb
2013-12-03 13:25:18 +00:00
Miles Gould
2a260abf05 Fix Postgres problem with PlantParts#crops
Postgres complains if the ORDER BY clause of a SELECT DISTINCT query is
not precisely one of the SELECTed fields. The default sort order on
crops is lower(name), and Postgres is not smart enough to notice that it
can calculate this from fields which are selected. The solution is to
override PlantParts#crops to remove the ORDER BY clause, and replace it
with `ORDER BY name`. This is not perfect, because it means the crops
associated to plant parts will not be sorted in the same order as crops
on the rest of the site.
2013-12-03 12:56:57 +00:00
Skud
60eb4c7296 Show aggregate 'grown from' data on crop page 2013-11-06 11:21:08 +11:00
Skud
ba27bb6490 plant parts have crops through harvests 2013-11-06 10:38:50 +11:00
Skud
ac5027ec27 Can't delete plant parts that are being used 2013-11-06 10:38:28 +11:00
Miles Gould
084bdc4f40 Add friendly URLs to plant parts. 2013-10-31 00:19:48 +00:00
Miles Gould
e9a3c0f4ee rails g scaffold PlantPart...
Also migration to remove the string plant_part.
2013-10-30 23:32:20 +00:00
Skud
5302dd58b1 Added pollen as a harvestable plant part 2013-10-29 17:31:16 +11:00
Skud
7a5bfa5e07 Added 'other' and 'whole plant' to harvestable plant parts 2013-10-29 17:28:51 +11:00
Skud
721692277d Added plant_part validation to harvest model 2013-10-29 17:17:12 +11:00
Skud
f89c5e5b86 Added plant_part attribute to harvest 2013-10-29 17:00:32 +11:00
Skud
0ae0e54369 Sort harvests by created_at DESC 2013-10-29 15:17:01 +11:00
Skud
aee0adde43 Added active/inactive scopes 2013-10-25 22:58:40 +11:00
Skud
96b5a6cd94 Added new garden fields to gardens/show 2013-10-25 22:48:02 +11:00
Skud
aee35aeeca Added new fields to garden form 2013-10-25 22:32:40 +11:00
Skud
803f8244c9 Added various fields to garden
- active (default: true)
- location, latitude and longitude (because when you move house, you
    don't take your garden with you)
- area and area units (square feet or metres)
2013-10-25 21:54:13 +11:00