Finalization
01 Jul 2016
Reading time ~2 minutes
What I Did
Today I went through my app to clean up obvious things here and there. Today is technically the deadline for when I was scheduled to have completed all of the delineated functionality for Haxxor-News. On a whole, I’ve accomplished the bare minimum for implementing said tasks. Before I feel comfortable releasing my app to the world, there is still a ton of improvements that I ought to make.
What I Learned
- Most databases have a concept of a sequence which auto increments as it is used. ActiveRecord uses the underlying database sequence to create primary keys. This phenomenon explains why after having destroyed all records related to a given model, the record id’s of newly created models were starting at numbers greater than zero…
- One should never neglect the back-trace of rails logs.
- Scopes are useful for selecting sub-collections of a given collection based on desired parameters. I will likely need to organize various scopes within a helper file that can be called with particular parameters to generate subsets of record collections like posts (ordering by date and vote ratings).
What I Still Don’t Understand
- I’m still very unclear on how to modify attributes in previous migration files and re-run migrations to ensure that everything is still intact. Today, I attempted to add
null: false
to a few attributes for my comment model, which broke my application. I was able to get things running again only after resetting my database and re-seeding it with freshly generated fake users and posts. Although this is not a big deal in development, I’ve got to know better for production.
What I’d Like To Learn
- I’m interested in getting my FED skills to a bare minimum especially because I’ve reached the point that my current app is at a bare minimum level in terms of structure.