--

3

Consolidator

https://github.com/Dave-Choi/consolidator

http://rocky-mountain-3186.herokuapp.com/

Woefully incomplete, in terms of referential integrity and desired features.  Lots of placeholders and crappy styles.  There are some controllers that really don't need to exist, but made sense before I had a mostly clear picture of Rails.  Some routes that have no links to access them.  Just wanted to get it out there to be embarrassed so I'll work on it faster.

Premise:

I wanted to make a system to manage collections of physical things, between groups of friends.

e.g. I recently had to replace my laptop's screen, and didn't feel like shelling out $200 to let a tech do it and learn nothing, so I bought the part, but needed a large, heavy suction cup to pull the glass off and complete the repair.  I have no other use for a 4" suction cup.  If I have a friend who needs one in the future, I'd like them to know that I have one available, so my money feels less wasted.

Alternatively, I enjoy playing video games, but I don't have much time to play them, and even if I bought them new, by the time I got around to playing them, they'd likely have depreciated in value a good deal, so I never buy them early.  I have friends who like playing new releases, though, and generally, they don't mind lending them to me when they're done.  Without a lot of replays, it seems like money wasted to have a lot of copies between my friends.

Early Development:

I'm primarily a front-end programmer, but I have a background in PHP/MySQL development, but without the use of frameworks, which means manual SQL and setting up database level referential integrity and whatnot.  I got fairly handy, but my productivity on the server side was never great.  I've recently been using Ember for a few projects (happy to be doing more development on the frontend), using its fixture adapter to use client-side data for development without hooking it up to an actual server data store.  I wanted to learn some Rails primarily to knock out quick REST JSON APIs, which Ember Data connects to easily.  The Ember core guys are also Rails core guys, so it seemed like a good move.

I stumbled a lot with just getting my machine configured to work with Rails, and after fighting with XCode and GCC installs, I gave up and just made a new user account, which is why all of my later commits are from Rails Dev.  This worked well, but I also had to set up all of my preferences again, which was kind of a drag, but since then it's been smooth sailing on the build and deploy front.

I followed the class lectures up until setting up the association between the Users and Pins, after which a lot of the content seemed too specialized for me to use.

Later development

I ended up doing a bunch of studying on my own after that fork from the Pinterest-style project, and skimming the code from the rest of the lectures.  

I started writing my own friend system before just stashing the changes, and using Amistad (https://github.com/raw1z/amistad), with some additional methods I threw into my User model that seemed to be missing.  The experience getting my own friend system started was useful for learning more about simpler association methods, but it was slowing me down and distracting me from working on the novel parts of my app.

If lending is too one-sided, it feels bad, even if you're not losing anything, and I wanted the system to be able to manage multiple ownership, and eventually allow people to pool money, so I can chip in on a new release I'd normally just borrow later.  Multiple ownership clouds up a lot of the relationships, though, for example, if I'm a partial owner, and another owner has the item, do you list that under items that are out on loan?  (I decided that if you're looking for something that you don't have in your possession, it doesn't matter if the other person who has it is also an owner, so yes, it goes in that view)  This sort of thing slowed me down a good amount.

Status Update - 4/14/13

Personal: I feel fairly comfortable with Rails at this point, for basic scaffolding and database migration changes, but not that solid on routing, and not great on ActiveRecord querying.  I fight the urge to just write the SQL a lot just to force myself to learn the Rails way.  If this project has legs, I just hope that the Rails way isn't terribly inefficient in its queries.  I worry that it is.

I also had to fight the urge to just use Rails as a JSON API for an Ember app, so I'd actually learn Rails proper.  It's kind of weird that it feels so antequated, though, having to reload whole pages all the time, and doing DOM manipulation on the server.  It is nice how quickly you can get a working project online, though.  It is complete, if not ideal.

Project: Basic friend management is in place, and bits and pieces of the Thing collection manipulation is in place, but I lost a lot of time to jumping into coding before really designing, working on views that the user will never actually see, which is normally a really bad idea, but without a familiarity with my tools, it's probably the right way to go.  Learning to recover from design errors is part of learning the system, and is the main thing I liked about the way Mattan structured this course.  You get something in place, and then add features to it organically, rather than having it just be, "Here, watch me type out a perfectly considered project from start to finish."

I'm currently stuck on trying to figure out the Rails/ActiveRecord way to set up a query for a list of things that the current user has borrowed, which I'm defining as items in the current user's possession that they don't have any ownership stake records for.  Arel (https://github.com/rails/arel) scoping is probably the way to approach it, but I don't believe it was touched on in the lectures, so I've been doing a lot of reading.

I am finding it surprising how incomplete some of the Rails features seem.

Status Update - 4/26/13

100+ commits in the past 12 days, but I do tiny commits and am lazy about branching.

I continued struggling with not just throwing all the data at JavaScript and dealing with it there, to force myself to learn more about Rails.  I feel a lot stronger in terms of querying ActiveRecord, and setting up useful scopes.  I also had a ton of broken model associations, but it clicked more recently how these are supposed to be used, and how to test them (in the console), and that felt like a huge step.

Everything has its own interpretation of MVC, and there were a few times when I wasn't sure what the best place was to put logic in the Rails interpretation.  Recently, I had some controls that were dependent on state (e.g. If someone wants to borrow something, the borrow button shouldn't be present if they already have it in their possession), and I made some helpers with hash lookups (e.g. https://github.com/Dave-Choi/consolidator/blob/master/app/helpers/borrow_requests_helper.rb ), and I'm pretty happy with that.

My schema is decidedly more complicated than Users with owned Pins, and there's still a lot of missing validation and dependent destroys and whatnot.  I tried to stay focused on the things that will add the most value to the app, which meant getting requests and approval/rejection working and showing the right sets and controls.  Again, multiple ownership slowed me down, but I think I learned more/better for having it.

I put in some half-assed UI elements to make it look less awful, but it needs a lot of work on that front.  I'd been scrambling to get all the underlying gears lined up right, so the frontend has been neglected.

I'm doing a feature freeze for the next few days, and I'm just going to polish up the UI, because I don't want to break it during peer review.  Sorry, if you're my peer reviewer and you had to read all of this.

Comments

Please sign in or sign up to comment.