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
So in setting up our own node, we played around in the rails console to create Users and Authors, since we couldn't get the login form to work initially. As a result, we had some orphaned Authors and some orphaned Updates.
What I see is that the site blows up because it is checking against id fields and calling other methods on associations that aren't there, especially on any page that uses the app/views/updates/_list.html.haml partial.
What I'd expect is that the site is resilient against bad data and simply doesn't display it, as well as some model logic to clean up orphaned associations on save.
This issue covers a wide range of things. It looks like there's a lot of database lookups happening in views, as well as a lot of Law of Demeter violations when walking current_user.author.some_method -- it looks like a lot of the models are really begging for a Decorator pattern to be applied.
I can start to write some test cases to reproduce bugs I've seen, but I think it might be worth discussing a plan of attack so that we can all agree on the best way (Decorators, extracting logic from views into controllers or helpers?) before beginning to try to solve this.
The text was updated successfully, but these errors were encountered:
I love decorators and the null object pattern.
On Sep 4, 2013 11:45 AM, "Matt Gauger" [email protected] wrote:
So in setting up our own node, we played around in the rails console to
create Users and Authors, since we couldn't get the login form to work
initially. As a result, we had some orphaned Authors and some orphaned
Updates.
What I see is that the site blows up because it is checking against idfields and calling other methods on associations that aren't there,
especially on any page that uses the app/views/updates/_list.html.hamlpartial.
What I'd expect is that the site is resilient against bad data and simply
doesn't display it, as well as some model logic to clean up orphaned
associations on save.
This issue covers a wide range of things. It looks like there's a lot of
database lookups happening in views, as well as a lot of Law of Demeter
violations when walking current_user.author.some_method -- it looks like
a lot of the models are really begging for a Decorator pattern to be
applied.
I can start to write some test cases to reproduce bugs I've seen, but I
think it might be worth discussing a plan of attack so that we can all
agree on the best way (Decorators, extracting logic from views into
controllers or helpers?) before beginning to try to solve this.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/776
.
So in setting up our own node, we played around in the
rails console
to create Users and Authors, since we couldn't get the login form to work initially. As a result, we had some orphaned Authors and some orphaned Updates.What I see is that the site blows up because it is checking against
id
fields and calling other methods on associations that aren't there, especially on any page that uses theapp/views/updates/_list.html.haml
partial.What I'd expect is that the site is resilient against bad data and simply doesn't display it, as well as some model logic to clean up orphaned associations on save.
This issue covers a wide range of things. It looks like there's a lot of database lookups happening in views, as well as a lot of Law of Demeter violations when walking
current_user.author.some_method
-- it looks like a lot of the models are really begging for a Decorator pattern to be applied.I can start to write some test cases to reproduce bugs I've seen, but I think it might be worth discussing a plan of attack so that we can all agree on the best way (Decorators, extracting logic from views into controllers or helpers?) before beginning to try to solve this.
The text was updated successfully, but these errors were encountered: