You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The reason will be displayed to describe this comment to others. Learn more.
Here's why:
In development mode, Rails lazy loads classes. It won't run that file until it needs to. This would lead us to believe that everything is OK. In production, it loads everything into memory ahead of time. There is (afaik) no such thing as embeds_many for AMS so this class threw a NoMethodError as soon as it started up in production. Pretty sure you could just do a has_many and it will be good enough. I will poke around later.
The reason will be displayed to describe this comment to others. Learn more.
Could we set it up so that testing could catch that?
I actually had a lot of issues with the whole embeds_many vs has_many shenanigans. You'll see traces of that here and there (no garden index page, all the commented-out code). It probably does need a second pair of (way more experienced) eyes.
The reason will be displayed to describe this comment to others. Learn more.
I think that the solution is to just write unit tests for your serializers. The reason Rails has that feature set is so that you can write code and not reset the server everytime.
The weird thing is that our coverage percentage didn't seem to drop?? I am going to take a look at coveralss and see.
The reason will be displayed to describe this comment to others. Learn more.
I will take a look at this tomorrow morning (Time.now + 8.hours). If you could shoot me a message on G+ of line numbers that were suspect, I would really appreciate it.
The reason will be displayed to describe this comment to others. Learn more.
The serializers get used whenever the API gets used, so that should explain why the coverage wouldn't have dropped? I'll send you a message with where I remember the problems being.
73989f3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmmmmm. This was causing the server to bug out?
73989f3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's why:
In development mode, Rails lazy loads classes. It won't run that file until it needs to. This would lead us to believe that everything is OK. In production, it loads everything into memory ahead of time. There is (afaik) no such thing as
embeds_many
for AMS so this class threw aNoMethodError
as soon as it started up in production. Pretty sure you could just do ahas_many
and it will be good enough. I will poke around later.73989f3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we set it up so that testing could catch that?
I actually had a lot of issues with the whole embeds_many vs has_many shenanigans. You'll see traces of that here and there (no garden index page, all the commented-out code). It probably does need a second pair of (way more experienced) eyes.
73989f3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that the solution is to just write unit tests for your serializers. The reason Rails has that feature set is so that you can write code and not reset the server everytime.
The weird thing is that our coverage percentage didn't seem to drop?? I am going to take a look at coveralss and see.
73989f3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will take a look at this tomorrow morning (
Time.now + 8.hours
). If you could shoot me a message on G+ of line numbers that were suspect, I would really appreciate it.73989f3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The serializers get used whenever the API gets used, so that should explain why the coverage wouldn't have dropped? I'll send you a message with where I remember the problems being.