Mackenzie Morgan
7b2be73c88
code climate
2016-12-01 00:22:52 -05:00
Mackenzie Morgan
cd0fbc80d8
Merge remote-tracking branch 'origin/photo_concern' into photo_concern
2016-12-01 00:19:42 -05:00
Mackenzie Morgan
31bbf42ad0
define valid models for photos in a constants file
...
remove all hardcoded model names from photo.rb and photos_controller.rb
2016-12-01 00:19:33 -05:00
Brenda Wallace
e06d110861
Turn on rails:true in rubocop
...
so we don't need to pass --rails
2016-12-01 13:30:00 +13:00
Shiny
b454132cae
Merge branch 'dev' into bw/useless-assignments
2016-12-01 12:51:13 +13:00
Brenda Wallace
cd0e287dba
removed member look up that wasn't used in spec
2016-12-01 12:50:16 +13:00
Shiny
771e6b649c
Merge branch 'dev' into photo_concern
2016-12-01 12:37:23 +13:00
Daniel O'Connor
547e6400f8
Merge pull request #1049 from maco/scopify
...
moving where clauses into scopes to keep that contained in models
2016-12-01 09:48:26 +10:30
Brenda Wallace
ce7cd5d96b
Merge branch 'dev' into bw/useless-assignments
2016-12-01 11:17:56 +13:00
Mackenzie
ba4d85538c
Merge branch 'dev' into scopify
2016-11-30 16:47:22 -05:00
Mackenzie
af3ca215a6
Merge branch 'dev' into photo_concern
2016-11-30 16:37:36 -05:00
Mackenzie Morgan
cef1bb1056
ignore has_and_belongs_to_many
2016-11-30 16:29:02 -05:00
Brenda Wallace
6321d1ac41
current order, use rails' findby
2016-12-01 10:17:22 +13:00
Mackenzie
57461f6e34
Merge pull request #1091 from pozorvlak/fix_display_days_before_maturity
...
Fix PlantingHelper.display_days_before_maturity
2016-11-30 10:09:36 -05:00
Cesy
cf8fab8ed9
Merge pull request #1080 from Growstuff/dev
...
Release 16
release16
2016-11-30 15:07:42 +00:00
Mackenzie Morgan
aa7ca71e5d
rubocop
2016-11-30 09:47:48 -05:00
Mackenzie Morgan
a5fcfb6277
Merge branch 'dev' of gitmaco:Growstuff/growstuff into photo_concern
2016-11-30 09:44:36 -05:00
Mackenzie
376e6c08d3
Merge pull request #1097 from pozorvlak/precompile_assets_in_test
...
Precompile assets in test
2016-11-30 09:44:15 -05:00
Mackenzie
0cbaac3c75
Merge pull request #1098 from pozorvlak/allow_unadorned_rake_without_db
...
Run tests with `rake` when DB does not yet exist
2016-11-30 09:43:40 -05:00
Miles Gould
6be9640625
Run tests with rake when DB does not yet exist
...
Previously, `rake spec` ran the tests whether or not the `growstuff_test`
database existed or not, but `rake` crashed unless it had already been
created. The problem was that `rake` was trying to load the environment,
which required the presence of a DB; `rake spec` was running this with
the `dev` environment, so succeeded if `growstuff_dev` existed, but
`rake` was running everything with the `test` environment, so would fail
if `growstuff_test` did not exist.
This patch adds `db:create` to the dependencies of the `spec` task,
forcing an unadorned `rake` to create all necessary databases first.
2016-11-30 11:35:35 +00:00
Miles Gould
1841548936
Precompile assets in test
...
According to
https://github.com/teampoltergeist/poltergeist/issues/677#issuecomment-222919584 ,
a possible cause of the "Request failed to reach server" problem (#901 )
is that assets are being compiled on-demand, causing enough of a
slowdown for PhantomJS to think the connection has failed. This turns
off lazy asset compilation in the test environment and precompiles
assets before testing on Travis. We should also turn off lazy asset
compilation in production - see
http://stackoverflow.com/questions/8821864/config-assets-compile-true-in-rails-production-why-not
Our Heroku deployments already run `rake assets:precompile`.
2016-11-30 11:01:25 +00:00
Miles Gould
9400225f65
Return a string from display_days_before_maturity
...
Sometimes we were returning a string, and sometimes we were returning an
integer. We're only ever displaying the result, and this seems a little
more consistent.
2016-11-30 10:16:02 +00:00
Miles Gould
b0b864a5d4
Fix off-by-one bug in display_days_before_maturity
...
We were counting from DateTime.now rather than Date.current, causing us to
under-count by a day.
2016-11-30 10:16:02 +00:00
Miles Gould
77c64d5925
Test PlantingHelper.display_days_before_maturity
...
This ensures that #1079 is fixed.
2016-11-30 10:15:52 +00:00
pozorvlak
d3b927b44b
Merge pull request #1096 from Growstuff/master
...
Master to dev for 1092
2016-11-30 09:44:12 +00:00
Mackenzie Morgan
77b7969fc9
DRY up photo & model interaction
...
* move stuff in models into a concern
* create combined collection for all models that have photos
2016-11-30 00:46:58 -05:00
Shiny
9d68690d86
Merge pull request #1092 from Br3nda/hotfix/1079
...
Check we have a planted_at ts before using
2016-11-30 17:50:15 +13:00
Brenda Wallace
900e7361c6
Check we have a planted_at ts before doing maths with it
2016-11-30 17:39:26 +13:00
Brenda Wallace
a2e86b3e5e
Rails dynamic finds fixed
2016-11-30 12:21:27 +13:00
Brenda Wallace
b6136d6a20
Removed ignores for rails findby
2016-11-30 10:38:00 +13:00
Mackenzie
7b0fdcf007
Merge pull request #1093 from Br3nda/bw/fix-deprecated-methods
...
Fixes for two calls to deprecated methods
2016-11-29 16:34:32 -05:00
Brenda Wallace
178c181cf5
Merge remote-tracking branch 'upstream/dev' into bw/useless-assignments
...
Conflicts:
app/controllers/crops_controller.rb
app/models/crop.rb
spec/models/scientific_name_spec.rb
2016-11-30 10:32:02 +13:00
Brenda Wallace
9aa4fa8031
Fixes for two calls to deprecated methods
2016-11-30 10:25:23 +13:00
Mackenzie Morgan
72877aebaf
update test for renamed scope
2016-11-29 13:41:05 -05:00
Mackenzie Morgan
4857fd8d2e
return from conditional
2016-11-29 12:20:17 -05:00
Mackenzie Morgan
99c8db72d6
syntax
2016-11-29 12:14:16 -05:00
Mackenzie Morgan
53849a26e5
merge
2016-11-29 12:11:52 -05:00
Mackenzie Morgan
9dc02cd3d8
make changes from code review
2016-11-29 12:10:48 -05:00
Mackenzie
391111a5bf
Merge pull request #1088 from maco/rename_scientific_name
...
rename scientific_names.scientific_name to scientific_names.name
2016-11-29 12:04:21 -05:00
Mackenzie Morgan
c93fd78aa8
Merge branch 'dev' of gitmaco:Growstuff/growstuff into scopify
2016-11-29 09:58:02 -05:00
Mackenzie
818c8f0c37
Merge pull request #1090 from pozorvlak/indentation-for-great-glory
...
Fix comment-style weirdness
2016-11-29 09:53:23 -05:00
Mackenzie Morgan
915030e583
whitespace
2016-11-29 09:40:59 -05:00
Mackenzie Morgan
832719b01a
merge from upstream dev
2016-11-29 09:37:25 -05:00
Miles Gould
0d8cbc5bf2
Fix comment-style weirdness
...
We had an inline comment that had been split over two lines; whitespace
fixes made this look very weird.
2016-11-29 10:44:04 +00:00
pozorvlak
bac8f5e4cc
Merge pull request #1072 from Br3nda/bw/indentation-for-great-glory
...
the giant indentation patch of 2016, for great glory
2016-11-29 10:42:24 +00:00
Mackenzie Morgan
69980d9ec6
tests
2016-11-28 22:50:53 -05:00
Mackenzie Morgan
2129b6480d
...that was a guard clause. oops
2016-11-28 22:42:11 -05:00
Mackenzie Morgan
fe860aa1ab
clean up some tests
2016-11-28 22:33:00 -05:00
Mackenzie Morgan
a382caab48
clear up redundant else and unneeded returns
2016-11-28 22:08:41 -05:00
Mackenzie Morgan
e1e9a52186
use a guard clause
2016-11-28 22:08:14 -05:00