Commit Graph

243 Commits

Author SHA1 Message Date
Maikel
5b0c8bbaef Merge pull request #3836 from Matt-Yorkley/fast_and_furious2
Improve /shops, /producers, and /groups performance
2019-06-21 15:02:19 +10:00
luisramos0
1da18d3386 Fix enterprise model scopes by making ready_for_checkout return enterprises and not ids again and by making not_ready_for_checkout select the id field from the ready_for_checkout scope 2019-06-18 10:52:56 +01:00
luisramos0
0cdb49818d Remove distinct from enterprise.ready_for_checkout scope
Adapt use of enterprise scope not_ready_for_checkout to rails 4 by adding enterprises table alias to selected field id
2019-06-18 10:40:49 +01:00
luisramos0
0d07bf2a3b Adapt enterprise.distributing_products scope to rails 4 2019-06-18 10:40:49 +01:00
Matt-Yorkley
698d3672a6 List only current taxons for active enterprises 2019-06-12 09:47:01 +01:00
luisramos0
ced6264846 Fix rubocop issues in enterprise model 2019-05-28 16:30:50 +01:00
luisramos0
ffbd79d3dd Change all model scopes without a callable object to use a proc 2019-05-28 15:55:13 +01:00
luisramos0
86b0d71c7e Result of rubocop auto-correct and rebuilding rubocop_manual_todo 2019-05-28 12:57:29 +01:00
Kristina Lim
7593168341 Update code style for Enterpise.not_ready_for_checkout
This was changed into multiple lines for readability.
2019-05-06 18:37:28 +08:00
Kristina Lim
c0a5bcce92 Update some comments in Enterprise and OrderCycle models 2019-05-06 18:35:01 +08:00
Kristina Lim
71bff0dd5b Reduce the number of queries in Enterprise.not_ready_for_checkout 2019-05-06 13:43:44 +10:00
luisramos0
c1d14686a6 Merge branch 'master' into 2-0-stable-Mar22 2019-03-22 10:55:17 +00:00
luisramos0
60ee17204b Merge branch 'master' into 2-0-stable-Mar16 2019-03-16 16:17:38 +00:00
luisramos0
a022cebfc8 Remove product distributions from enterprise model and controller 2019-03-13 11:49:13 +00:00
Pau Perez
6e9bb640f6 Add spacing between long scopes 2019-02-26 11:36:36 +01:00
luisramos0
0501db1782 Remove changes related to enterprise trials as they dont make sense without business models and account invoices 2019-02-25 14:37:16 +00:00
luisramos0
36e2786a1e Delete Accounts and Billing dead feature code 2019-02-25 14:37:16 +00:00
Maikel
d8d20429aa Revert "Instagram pattern" 2018-11-09 13:33:11 +11:00
fabricio.albarnaz
419493f153 Move instagram regex to an method to fix codeclimate 2018-10-16 16:09:15 -03:00
fabricio.albarnaz
93a051bf5a Regex ajust 2018-10-16 15:33:10 -03:00
fabricio.albarnaz
02bc134c59 Change befor save check to format validation 2018-10-15 17:51:33 -03:00
fabricio.albarnaz
6ad32fb66d Add check for instagram.com 2018-10-11 18:05:18 -03:00
fabricio.albarnaz
e46b3566c3 Remove the check for www.instagram.com 2018-10-11 16:51:43 -03:00
fabricio.albarnaz
e87075aed7 Add before save to check the instagram link pattern 2018-10-11 15:27:46 -03:00
Maikel Linke
306bfa1944 Remove unused method enterprise method
`Enterprise.has_supplied_products_on_hand?` is not used anywhere.
2018-06-27 11:25:44 +10:00
Maikel Linke
792701297b Remove unused scope Enterprise.active_distributors
Working on the Spree upgrade, we found that this scope is using the soon
obsolete column `spree_products.count_on_hand`. Trying to measure the
impact of changing this scope, I couldn't find any use of it.

There is a variable called `active_distributors` used when serialising
enterprises, but that variable is initialised with
`Enterprise.distributors_with_active_order_cycles.ready_for_checkout`,
not using the `active_distributors` scope.

See also:
https://github.com/openfoodfoundation/openfoodnetwork/issues/2013
2018-06-27 11:12:54 +10:00
Matt-Yorkley
d9623176fb Include admin users as managers on new enterprises 2018-06-21 13:21:08 +10:00
Pau Perez
5a182e8e88 Remove enterprises producers tab from dashboard 2018-05-22 10:21:35 +02:00
Pau Perez
147a74f005 Fix Rubocop violations reported by Code Climate 2018-04-16 10:27:44 +02:00
Pau Perez
e4c86df7b2 Auto correct Rubocop's Layout/CaseIndentation cop 2018-04-09 17:19:47 +02:00
Matt-Yorkley
cc5d0c35dd Refactor enterprise contact user assignment 2018-02-07 10:41:53 +11:00
Matt-Yorkley
9248ac05ac Adjustments for failing specs 2018-02-07 10:41:53 +11:00
Matt-Yorkley
4d11485283 Use receives_notifications flag for enterprise contact 2018-02-07 10:41:53 +11:00
Matt-Yorkley
ba98c7e2c5 Rewrite enterprise contact functionality 2018-02-07 10:41:52 +11:00
Matt-Yorkley
22eae753fe Remove enterprise confirmations 2018-02-07 10:41:52 +11:00
Enrico Stano
660d3f326f Remove unused Enterprise scopes 2017-12-20 16:00:35 +11:00
Rob Harrington
cd6d7c76f6 Fix spec that requires preference persistence 2017-11-02 17:43:04 +11:00
Rob Harrington
0e14704572 Kill empty space 2017-09-23 14:58:33 +10:00
Steve Pettitt
06279848c6 Stripe auth and callback working. Still need to process callback. 2017-09-23 14:57:02 +10:00
Steve Pettitt
df18329233 Starting Stripe integration 2017-09-23 14:57:01 +10:00
Julius Pabrinkis
9971c9f923 Extract translations from models 2017-07-21 12:17:12 +10:00
Pau Perez
cee24dcca7 Use indented style for multiline method calls
This enables the Rubocop's Style/MultilineMethodCallIndentation cop with
indentend enforced style. Which makes you split multiline method calls like:

  orders = Spree::Order
    .an_scope
    .another_scope
    .where(id: list_of_ids)

It also autofixes the current violations and updates the
rubocop_todo.yml
2017-07-12 10:40:53 +02:00
Rob Harrington
017916b193 Enterprise distributing_products scope uses INNER JOINS instead of OUTER JOINS 2017-01-17 19:28:21 +11:00
Rohan Mitchell
44a301edb1 When touching distributing enterprises, do not touch self -> infinite recursion 2016-11-25 14:14:42 +11:00
Rohan Mitchell
dabac50128 Replace Enterprise.distributing_product and Enterprise.distributing_any_product_of with Enterprise.distributing_products 2016-11-25 14:14:42 +11:00
Rohan Mitchell
9b656eaf4f Property / ProducerProperty changes update distributor enterprise cache 2016-11-25 14:14:42 +11:00
Rohan Mitchell
a6a0bdb063 Sanitize values before they're used 2016-11-04 09:39:17 +11:00
Maikel Linke
f733c7f207 Include shop enterprise on shop front 2016-07-06 12:45:12 +10:00
Maikel Linke
f984871b23 Inject only needed enterprises into cart and checkout 2016-07-06 11:14:13 +10:00
Maikel Linke
c253d73d11 Refactoring with feedback on pr #1073 2016-06-29 15:46:51 +10:00