Commit Graph

46 Commits

Author SHA1 Message Date
Rohan Mitchell
20745825bf Fix finding producers for shopfront, moving to SQL-land in the process. Woo. 2014-03-26 12:56:58 +11:00
Rohan Mitchell
abf83b0e58 Find only outgoing exchanges for Enterprise scopes using with_order_cycles_outer 2014-03-26 12:07:06 +11:00
Will Marshall
2bb004ebaa Adding notes field to products 2014-02-04 14:11:32 +11:00
Will Marshall
aec5894c70 Adding a promo image to enterprises 2014-01-21 16:32:55 +11:00
Will Marshall
cbce5958e0 Removing an attr_accessible which breaks EVERYTHING 2014-01-16 15:47:38 +11:00
Will Marshall
0ddef9626e First working image upload for enterprise logos 2014-01-16 15:47:38 +11:00
Will Marshall
b8fcfbd72b Test and implementation: dropping inclusion of product_distributions from active Distributors on front page - BugHerd#125 2013-11-01 14:48:23 +11:00
Rohan Mitchell
758676c1ea When visiting supplier page without selecting a distributor, provide choice of distributors that distribute their products 2013-10-31 14:49:26 +11:00
Rohan Mitchell
e78815c2d3 Create models for EnterpriseGroups 2013-10-30 10:42:32 +11:00
Rohan Mitchell
c07c52085a Enterprise user can view and create shipping methods 2013-10-18 09:35:53 +11:00
Rohan Mitchell
19349c805f Destroy supplied products when a supplier is destroyed 2013-09-23 14:58:26 +10:00
Rohan Mitchell
4956a4e384 Only geocode addresses associated with enterprises. Makes Checkout#update much faster. 2013-09-19 16:56:48 +10:00
Rohan Mitchell
08941ae22b Data integrity 2013-09-19 11:22:55 +10:00
David Cook
107c6978c2 Create many-to-many relationship between payment method and distributor 2013-09-13 10:25:25 +10:00
alexs
4e715f62a2 Moved limit into the model. 2013-08-16 09:53:40 +10:00
alexs
cfffced652 Fixed the bug in the enterprise geo search. 2013-08-15 16:33:41 +10:00
Rohan Mitchell
7e30b664f2 Add enterprise fees relation to enterprise 2013-08-13 09:11:26 +10:00
alexs
b5cc2ab4cf Added postcode search that redirect to page with map view. 2013-08-09 13:20:22 +10:00
alexs
f45ed42bdb Skeleton for the search results. 2013-08-08 11:42:45 +10:00
Andrew Spinks
e75021d7bd Fix loading of products for an enterprise in the admin section. NOTE: this is a major hack - had to copy the current fetch data from the spree product_controller and modify it to get the roles to take affect. There must be a better way. 2013-08-02 18:13:42 +10:00
Andrew Spinks
9d32a5775a Enterprise user admin: only allow suppliers and distributors that we manage to be selected when creating and editing products. 2013-08-02 16:08:10 +10:00
Andrew Spinks
4f5679aac3 Add EnterpriseRole model and link up to users and enterprises. 2013-08-01 10:32:49 +10:00
Rohan Mitchell
7640eb497a Merge branch 'supplied-active-products-on-hand'
Conflicts:
	app/controllers/application_controller.rb
	app/models/enterprise.rb
	app/views/spree/products/_source_sidebar.html.haml
	spec/features/consumer/distributors_spec.rb
	spec/models/enterprises_spec.rb
2013-07-29 11:05:42 +10:00
Andrew Spinks
7cb054f430 Merge branch 'master' into order-cycle-selection
Conflicts:
	Gemfile
	Gemfile.lock
	app/controllers/spree/orders_controller_decorator.rb
	app/models/enterprise.rb
	app/models/spree/order_decorator.rb
	app/views/spree/checkout/_other_available_distributors.html.erb
	app/views/spree/products/_add_to_cart.html.haml
	lib/open_food_web/distributor_change_validator.rb
	spec/spec_helper.rb
2013-07-23 14:42:57 +10:00
David Cook
250e76c281 Fix incorrect count of enterprises (due to bug in rails issue #5554) 2013-06-21 15:10:21 +10:00
David Cook
2d64e257ff break long lines into two; no functional change 2013-06-21 10:45:11 +10:00
Rohan Mitchell
cfcc8c3fb2 Fix DistributionChangeValidator#variants_available_for_distribution: Do not show products distributed through a different order cycle 2013-06-21 10:34:39 +10:00
Rohan Mitchell
1b25364160 Cherry-pick c3b2f52: Cache DistributorChangeValidator#all_available_distributors, move Enterprise#available_variants into SQLland - massive render speed improvement
Conflicts:

	app/models/enterprise.rb
	lib/open_food_web/distribution_change_validator.rb
2013-05-28 13:01:07 +10:00
vagrant
4e7f966429 add suppliers scope, limit by 5, test 2013-05-22 13:07:30 +10:00
Rohan Mitchell
c3b2f52b7a Cache DistributorChangeValidator#all_available_distributors, move Enterprise#available_variants into SQLland - massive render speed improvement 2013-05-20 21:16:43 +10:00
Rohan Mitchell
6e7ee6481d Fetch enterprises that are distributing a product via a product or order cycle distribution 2013-04-12 10:13:04 +10:00
Rohan Mitchell
f66ff0f8b1 Rename Enterprise#available_variants to distributed_variants to remove ambiguity between supplied/distributed variants 2013-04-05 16:51:51 +11:00
Rohan Mitchell
5649a50e28 Add tests around Enterprise#available_variants, make it also show variants distributed via an order cycle 2013-04-05 16:49:27 +11:00
Rohan Mitchell
c9d1573049 Remove placeholder scopes, use new Enterprise.active_distributors scope for loading sidebar distributors 2013-03-08 16:56:58 +11:00
Rohan Mitchell
b25dcaa92b Enterprise.active_distributors doesn't show distributors from inactive order cycles 2013-03-08 16:54:22 +11:00
Rohan Mitchell
2a890f80f4 Enterprise.active_distributors doesn't show distributors of out of stock products 2013-03-08 16:48:35 +11:00
Rohan Mitchell
13abf9ada7 Enterprise.active_distributors doesn't show distributors of unavailable products 2013-03-08 16:46:25 +11:00
Rohan Mitchell
cd61bad0b9 Enterprise.active_distributors doesn't show distributors of deleted products 2013-03-08 16:43:45 +11:00
Rohan Mitchell
00d7fcbfb6 Enterprise.active_distributors finds active distributors by order cycles 2013-03-08 16:39:42 +11:00
Rohan Mitchell
977344e279 Rewrite scope with outer join 2013-03-08 16:31:54 +11:00
Rohan Mitchell
98cad56e7c Enterprise.active_distributors finds active distributors by product distributions 2013-03-08 16:23:45 +11:00
Rob H
6a45e8be3b Make tests pass after changes to checkout broke them all 2013-01-18 15:29:36 +11:00
Rob H
8a37b4e918 Push validation logic for changing distributor down into lib class 2012-12-14 11:02:01 +11:00
Rohan Mitchell
c2133d70ac Rename Enterprise is_supplier scope to is_primary_producer 2012-11-01 15:02:57 +11:00
Rohan Mitchell
abe3feb996 Integrate functionality from distributor into enterprise 2012-10-28 17:46:45 +11:00
Rohan Mitchell
c700d9e71b Create enterprise model, integrate functionality from supplier 2012-10-28 13:24:26 +11:00