Commit Graph

209 Commits

Author SHA1 Message Date
Skud
2b6bdeda16 Merge branch 'dev' of https://github.com/Growstuff/growstuff into dev
Conflicts:
	spec/views/crops/show.html.haml_spec.rb
2013-07-23 19:35:31 +10:00
Ryan Clark
e9dd18d977 Added tradable and tradable_to to seeds 2013-07-17 18:25:55 -07:00
Ryan Clark
973567bfdc Remane use_by to plant_before to humor Skud 2013-07-17 18:24:12 -07:00
Skud
491e97c997 connected seeds into other parts of the site 2013-07-15 23:29:14 +10:00
Skud
cc711a0a48 prettified seed-related views 2013-07-15 22:53:30 +10:00
Skud
91ea5146ac rails g scaffold seed... 2013-07-15 22:53:29 +10:00
Skud
ece34149a2 need to test sunniness/planted_from.blank? 2013-07-11 22:15:56 +10:00
Miles Gould
4d9ddd2707 Crop: method to return hash of planted_from frequencies
Also tidied up tests which relied on the default planting factory having
a planted_from value set.
2013-07-11 13:01:52 +01:00
Miles Gould
fbc64a1ee2 Crop: method to return hash of sunniness values. 2013-07-11 12:13:38 +01:00
Skud
7801a7ec09 Merge branch 'dev' into staff 2013-07-09 10:05:37 +10:00
Skud
ec80b01c7a cleaning up tests on postgres
- still trying to make sure we explicitly use a real member, not just
assume there's one with id = 1

- also it looks like the tests for post activity are passing for obscure
reasons on sqlite when they shouldn't be. this is a known bug
(https://www.pivotaltracker.com/story/show/51280861) apparently
invisible to us under sqlite.
2013-07-08 12:18:51 +10:00
Skud
878af07419 gave up on not_staff, shuffling interesting members instead 2013-07-08 11:54:55 +10:00
pozorvlak
f16999c3bd Merge pull request #246 from Skud/older-photos
view/select older flickr photos
2013-07-05 08:52:25 -07:00
Skud
db16ad34f7 view/select older flickr photos 2013-07-05 22:07:55 +10:00
Skud
b71ac3decb added planted_from (eg seed, seedling) 2013-07-05 20:53:11 +10:00
Skud
e4dd0f98e8 Merge pull request #243 from lucymclaughlin/forex_link
Forex link
2013-07-04 01:28:40 -07:00
Lucy
778d7a68c3 Fix bug in order total; add conversion link to order show.
The old order total method did not account for quantities. The
view test for order totals was not catching this, so we've
strengthened it. We also added a conversion link to the order
summary page and created an additional test to check that orders
with more than one item were generating the correct total.
2013-07-03 14:10:37 +01:00
Lucy
650f24099d Added default account type of "Free" in config/applications.rb 2013-07-03 11:04:42 +01:00
Miles Gould
5bcd4c2edd Use ActiveRecord methods for not_staff join code.
- set member.account_type directly in tests, because changes to
   member.account.account_type weren't being persisted.
2013-06-26 10:55:19 +01:00
Miles Gould
f6073ab01c Remove "if account_type" checks in Account.
- remove account_type_string method
 - simplify paid_until_string.
2013-06-26 10:55:19 +01:00
Miles Gould
0a8aaf0ee6 Create free account type if it doesn't exist; fix tests. 2013-06-26 10:55:19 +01:00
Lucy
6ccf8f397f Give new users a free account. 2013-06-26 10:55:18 +01:00
Miles Gould
c6eb835771 Tests and sketch implementation of not_staff scope.
It doesn't work and we don't yet know why :-(
2013-06-26 10:55:18 +01:00
Skud
2ecbd8315d bugfix: don't say 'not yet set' in planting form
PT: https://www.pivotaltracker.com/story/show/51457917

Maco found this. The problem was that if you had a blank planting date,
and then re-edited the planting, it would say "not yet set" in the form
field, then die when it later tried to convert that to a date.

I replaced Miles's planted_at_string stuff in the model with a simpler
parse_date method in the application helper.
2013-06-11 16:08:02 +10:00
Skud
903f0c808c cache recent_posts and recent_plantings partials 2013-06-07 17:52:31 +10:00
Skud
cb3e0fb526 added optional recommended price to products 2013-06-07 09:53:40 +10:00
Skud
6cf64694f4 added account status info in various places 2013-06-06 21:07:54 +10:00
Skud
629020237b Merge branch 'dev' into payments-new 2013-06-04 21:20:24 +10:00
Miles Gould
a5d14321b5 Merge branch 'dev' into delete_photos
Conflicts:
	spec/models/planting_spec.rb
2013-06-04 11:45:44 +01:00
Skud
89a5a777e6 Merge branch 'dev' into payments-new
Conflicts:
	.gitignore
	app/models/ability.rb
	app/models/member.rb
	db/schema.rb
2013-06-04 19:42:00 +10:00
Skud
a3d0f15fd5 Delete photo from photos/show page 2013-06-04 13:02:29 +10:00
Skud
43798231dd added crop photos and a new placeholder image 2013-06-04 12:22:31 +10:00
Skud
2a301d352b Reverted uniqueness limits for photo/planting association
It seems this interacts badly with the default_scope on postgres (but
    not on sqlite3).  Error message from the logs:

2013-06-01T02:21:05.312099+00:00 app[web.1]: ActiveRecord::StatementInvalid (PG::Error: ERROR:  for SELECT DISTINCT, ORDER BY expressions must appear in select list
2013-06-01T02:21:05.312099+00:00 app[web.1]: LINE 1: ...photo_id" = 2 AND "plantings"."id" = 181 ORDER BY created_at...
2013-06-01T02:21:05.312099+00:00 app[web.1]:   app/controllers/photos_controller.rb:59:in `create'
2013-06-01T02:21:05.312099+00:00 app[web.1]:                                                              ^
2013-06-01T02:21:05.312099+00:00 app[web.1]: : SELECT  DISTINCT 1 AS one FROM "plantings" INNER JOIN "photos_plantings" ON "plantings"."id" = "photos_plantings"."planting_id" WHERE "photos_plantings"."photo_id" = 2 AND "plantings"."id" = 181 ORDER BY created_at desc LIMIT 1):

For now, we'll just have to rely on the controller (which adds the
association) to keep things unique.
2013-06-01 12:25:43 +10:00
Skud
6ecbf749eb Avoid duplicate photos on plantings (or vice versa)
Strictly speaking this doesn't prevent you adding them if you really
try, but the validation for that was beyond what I could figure out (the
docs don't help, and all SO/blog posts are outdated and didn't
work).

However, if you do somehow manage to add dups, you will never see them
again thanks to the :uniq => true in the model.  That's good enough for
me.
2013-06-01 12:07:17 +10:00
Skud
cab7348a35 show plantings on photo page 2013-05-31 23:13:47 +10:00
Miles Gould
c734f62189 Plantings HABTM photos. 2013-05-31 13:10:54 +01:00
Miles Gould
44a236d90d Display all photos on index page. 2013-05-31 12:05:09 +01:00
Miles Gould
20eeec43ca Merge branch 'dev' into photos
Conflicts:
	db/schema.rb
2013-05-31 11:24:19 +01:00
Skud
7a1eaeffee added admin controller and index view 2013-05-29 14:37:42 +10:00
Skud
b60790c8ad record paypal token/payer id on completion, for reference 2013-05-29 13:41:34 +10:00
Skud
89b62e18df Roughly got Paypal working, after much messing around.
Still need more tests for the orders_controller, and to store the token
when it's returned.
2013-05-28 16:37:44 +10:00
Skud
dd556d8638 Merge branch 'dev' into payments-new 2013-05-28 14:07:53 +10:00
Skud
5b2fe1b415 Merge branch 'dev' of https://github.com/Growstuff/growstuff into comments-rss
Conflicts:
	db/schema.rb
2013-05-24 14:57:17 +10:00
Skud
e17dcf8671 Reordered comments: they are now DESC by default
Added scope "post_order" to order them ASC for display on post page.
Also tweaked post/comment views a bit.
2013-05-24 14:36:58 +10:00
Skud
89069b4bd2 don't allow multiple order items per order 2013-05-22 11:22:10 +10:00
Skud
f138c99846 Merge branch 'dev' into payments-new
Conflicts:
	db/schema.rb
2013-05-22 10:21:43 +10:00
Skud
dad64d41fb show account status/upgrade button in various places 2013-05-20 12:57:35 +10:00
Skud
d601396741 moved the update_order method from product to member 2013-05-20 11:35:10 +10:00
Skud
c644753a9b Call update_account when you complete an order.
Also had to tweak product.update_account to actually save the account!
2013-05-18 11:32:14 +10:00
Skud
7c2fc52009 added update_account method to order 2013-05-18 11:26:29 +10:00