Commit Graph

452 Commits

Author SHA1 Message Date
Lucy
3ce246ef5a Allowing Miles to drive. 2013-06-26 10:55:18 +01:00
pozorvlak
5748c0989e Merge pull request #233 from Skud/planted-at-bug
Planted at bug
2013-06-23 07:43:52 -07:00
Miles Gould
1f5c81fdca Filter spec files out of coverage reports. 2013-06-13 20:38:26 +01:00
Miles Gould
033703e9b9 Set up Rails coverage groups. 2013-06-13 20:29:02 +01:00
Miles Gould
66a6f53ae7 Set up Coveralls integration for test coverage. 2013-06-12 13:03:05 +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
df60a7c4dc display recommended price on product admin pages 2013-06-07 11:36:03 +10:00
Skud
cb3e0fb526 added optional recommended price to products 2013-06-07 09:53:40 +10:00
Skud
8046790bc7 converted product description to text (not string) 2013-06-07 09:16:18 +10:00
Skud
4c2971f670 oops, fixed broken test for checkout button 2013-06-06 21:19:24 +10:00
Skud
6cf64694f4 added account status info in various places 2013-06-06 21:07:54 +10:00
Skud
170315e4bd added test for default_photo ordering 2013-06-06 20:28:33 +10:00
Miles Gould
cebd6e05ac Merge branch 'dev' into logged-out
Conflicts:
	spec/views/home/index_spec.rb
2013-06-04 13:54:49 +01:00
Miles Gould
a0c91ee884 Changes to homepage
- only show interesting members if logged out
 - don't show your recent posts/plantings
 - change limits on posts/plantings for better visual balance.
2013-06-04 12:59:37 +01: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
39d1a74745 misc tidying up 2013-06-04 20:27:56 +10: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
c63eb64565 photo and planting owners must match 2013-05-31 23:35:07 +10:00
Skud
cab7348a35 show plantings on photo page 2013-05-31 23:13:47 +10:00
Skud
d635d58bf1 show photos on planting page 2013-05-31 22:56:32 +10:00
Miles Gould
e072883bb9 Connect plantings to photos. 2013-05-31 13:10:54 +01: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
b2916e28f3 Don't recreate photos, but update metadata. 2013-05-31 11:48:24 +01:00
Miles Gould
b1b24c4323 Delete unused photos_helper. 2013-05-31 11:28:59 +01:00
Miles Gould
20eeec43ca Merge branch 'dev' into photos
Conflicts:
	db/schema.rb
2013-05-31 11:24:19 +01:00
Skud
08c3ec7dec Vendored the activemerchant gem to help with testing
We needed a bogus paypal gateway as per
http://infotrope.net/2013/05/31/testing-paypal-express-with-activemerchants-bogusgateway-and-how-to-make-it-work/

Tests now pass usefully.
2013-05-31 12:15:23 +10:00
Skud
cbca8c19a5 added admin controller and index view 2013-05-31 10:23:06 +10:00
Skud
7a1eaeffee added admin controller and index view 2013-05-29 14:37:42 +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
18b92b133b Added titles to comment items in RSS 2013-05-24 14:43:45 +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
425a2b03fd Added RSS feed for comments on a single post 2013-05-24 13:43:06 +10:00
Skud
0d3588535e Added RSS feed for all comments 2013-05-24 13:29:17 +10:00
Skud
57f8575ab9 removed unwanted @recent_comments, replaced w pagination 2013-05-24 12:54:57 +10:00
Craig Read
9437e65763 Replaced plantings RSS with HAML
Removed the redundant @recent_plantings variable and added pagination
2013-05-24 12:43:51 +10:00
Craig Read
d563f0ceae Converting crops RSS to HAML
Added spec for crops RSS

Removed redundant @new_crops instance variable (not needed as we now
have pagination).
2013-05-24 12:22:41 +10:00
Craig Read
9c2fed461d Removed redundant @recent_posts instance variable
Not required, as we have pagination by default
2013-05-24 12:05:47 +10:00
Craig Read
bc03a5c488 Converted Posts RSS to HAML 2013-05-24 11:58:40 +10:00
Skud
98beebd697 fixed bug with non-int prices
now if you choose to pay 33.33 it doesn't round to 33.00
also removed PUT and DELETE actions from order items
(we don't want them for now, can reinstate later if/when we do.)
2013-05-22 11:51:38 +10:00
Skud
257db239fd remove unneeded edit/new actions from order_item 2013-05-22 11:25:48 +10:00
Skud
89069b4bd2 don't allow multiple order items per order 2013-05-22 11:22:10 +10:00
Skud
f955d14149 Don't display shop if they already have a paid account
This works fine in reality, but we can't figure out how to write tests
for it.  For some reason the @member object, which passes a test for
is_paid?, doesn't get recognised as such when it's passed through to the
view itself. Help?
2013-05-22 10:57:20 +10:00