1
0
Fork 0
Commit Graph

48 Commits

Author SHA1 Message Date
Andrew Tomaka 132e893b14 Merge branch 'master' of git.atomaka.com:atomaka/creddit 2016-01-26 11:16:08 -05:00
Andrew Tomaka c4e3adc187 Update to rails 4.2.5.1 (bundle update) 2016-01-26 11:15:38 -05:00
Andrew Tomaka 5e8311c777 Merge branch 'atomaka/bugfix/moren1' into 'master'
Fix some more n+1 stuff

Some quick fixes. Only noteworthy thing is nested includes can be done as so:

```
Comments.all.includes(post: :subcreddit)
```

See merge request !25
2015-12-23 22:06:51 +00:00
Andrew Tomaka 5c4eca47a6 Fix some more n+1 stuff 2015-12-23 17:01:23 -05:00
Andrew Tomaka 1f9788309b Merge branch 'atomaka/feature/authorization' into 'master'
Add authorization via Pundit

Also includes some a refactor to null object pattern for guest users.

See merge request !24
2015-12-23 20:47:12 +00:00
Andrew Tomaka d74152c5f9 Add authorization via Pundit 2015-12-23 15:44:58 -05:00
Andrew Tomaka 51f4d71dfd Merge branch 'atomaka/refactor/metric-clean-up' into 'master'
Clean up metric_fu violations

Clean up many of our violations. Most of these are meaningless fixes that do not resolve the actual issue.  For example, we use delegate to remove the law of demeter violations, but that doesn't really resolve the issue.  We pass some more stuff though and that's good enough for now.

See merge request !23
2015-12-11 21:08:28 +00:00
Andrew Tomaka 0d941a3cd3 Clean up metric_fu violations 2015-12-11 16:06:10 -05:00
Andrew Tomaka c940d1a6d3 Merge branch 'atomaka/bugfix/n+1' into 'master'
Fix many N+1 queries

Many N+1 queries have surfaced while throwing stuff together.  This takes care of them.

See merge request !22
2015-12-11 20:19:45 +00:00
Andrew Tomaka 52358fa68a Fix many N+1 queries 2015-12-11 15:15:33 -05:00
Andrew Tomaka d5c7229f90 Merge branch 'atomaka/feature/front-page' into 'master'
Add a quick front apge

Hack in a front page so that we can keep trucking along.  This uses posts#index to show all posts.  We also added some title stuff in this commit.

See merge request !21
2015-12-11 20:08:29 +00:00
Andrew Tomaka 6993bb0ecd Add a quick front apge 2015-12-11 15:05:16 -05:00
Andrew Tomaka 0e50dd92f8 Merge branch 'atomaka/bugfix/tests' into 'master'
Fix uniqueness issues with Faker

Faker will not always make unique data.  Let's toss a sequence on fields that require uniqueness.

See merge request !18
2015-11-20 13:55:25 +00:00
Andrew Tomaka a853facea2 Fix uniqueness issues with Faker 2015-11-20 08:49:32 -05:00
Andrew Tomaka b8a526c19f Merge branch 'atomaka/feature/ci' into 'master'
Use built-in Gitlab CI

Use Gitlab-ci to do some fancy things.

See merge request !17
2015-11-19 19:52:40 +00:00
Andrew Tomaka be71ab4309 Use built-in Gitlab CI 2015-11-19 14:46:34 -05:00
Andrew Tomaka 76610ede87 Merge branch 'atomaka/feature/simple-user-profile' into 'master'
Add a simple user profile

Adds a profile and links to it.  Also includes a refactor on the page header.

See merge request !16
2015-08-12 15:56:44 -04:00
Andrew Tomaka b68960efe5 Refactor page header code 2015-08-12 15:31:30 -04:00
Andrew Tomaka c880ba31b8 Creaet simple user profile 2015-08-12 14:48:44 -04:00
Andrew Tomaka 4636bc837d Merge branch 'atomaka/feature/comments' into 'master'
Add comments to creddit

Initial pass at commenting with some things left to consider.  Primarily, double nesting of resources is advised as poor practice.  Investigate alternatives.  Testing on comments isn't entirely complete (delete missing and some other things).  Comment replies need to be moved to inline. 

See merge request !15
2015-08-05 22:04:04 -04:00
Andrew Tomaka bbdc0001b4 Initial attempt at comments 2015-08-05 19:53:17 -04:00
Andrew Tomaka 7f540a73e1 Merge branch 'atomaka/refactor/demeter-fixes' into 'master'
Fix some law of demeter violations

```
@post.user.username
```

is not good

```
delegate :username, to: :user, prefix: true
@post.user_username
```

is apparently good? Although I've never really seen the advantage since I feel like we're just masking an underlying problem.  But at least it looks a little nicer.

See merge request !14
2015-07-20 15:18:56 -04:00
Andrew Tomaka 86e1cd891c Fix some law of demeter violations 2015-07-20 15:15:57 -04:00
Andrew Tomaka 95fe1fab7f Merge branch 'atomaka/feature/friendly_id' into 'master'
Replace homegrown slug with friendly_id

See merge request !13
2015-07-16 02:31:27 -04:00
Andrew Tomaka 19b6d7a8cd Replace homegrown slug with friendly_id 2015-07-16 02:26:27 -04:00
Andrew Tomaka 31abbd99e7 Merge branch 'atomaka/feature/reddify-1' into 'master'
Layout fixes to be closer to reddit

Design setup closer to Reddit.  Sidebar, header, posts, etc.  Hacky for now.  Fix later after spending more time in views.

See merge request !12
2015-07-15 23:41:06 -04:00
Andrew Tomaka 0b9286d152 Layout fixes to be closer to reddit 2015-07-15 23:39:55 -04:00
Andrew Tomaka 1e3665ab42 Merge branch 'atomaka/feature/post' into 'master'
Add posts

Not complete, but implemented basic posting to subcreddits.  Right now, links aren't taken into account (but basic modeling is in).  Enough to continue.

See merge request !11
2015-07-14 23:11:15 -04:00
Andrew Tomaka ade54533e6 Add ability to create posts 2015-07-14 22:27:55 -04:00
Andrew Tomaka f8113c22ab Merge branch 'atomaka/feature/integration-testing' into 'master'
Add some basic integration testing

Rushed but it'll work for now

See merge request !9
2015-07-14 13:54:10 -04:00
Andrew Tomaka 7975ec2012 Add some basic integration testing
Rushed but it'll work for now
2015-07-14 13:51:15 -04:00
Andrew Tomaka 2cac3d9f1c Merge branch 'atomaka/feature/subcreddit' into 'master'
Add subcreddits

Reddit has subreddits. We have subcreddits.  Get it?  Because we're subcreddit.

See merge request !8
2015-07-13 17:04:45 -04:00
Andrew Tomaka d3dd0ff848 Add the subcreddit MVC
Notes on closing subcreddit:

This doesn't seem great.  Would be slightly better if closed could be referenced
as true or false instead of '0' or '1' in the model.  Testing this is a bit
messy, but Tiemcop makes it a bit better.

Notes on subcreddit validations:

This is still not ideal.  For starters, from
http://guides.rubyonrails.org/active_record_validations.html:

"Note that some databases are configured to perform case-insensitive searches
anyway."

It also seems difficult to validate fields that are set in before_save since
validations occur before callbacks.  Revisit this (perhaps friendly_id wll save
us).
2015-07-13 17:01:12 -04:00
Andrew Tomaka 527dc493c6 Merge branch 'atomaka/refactor/downcase-test-fix' into 'master'
Slight organization cleanup in users tests

Downcasing of the email address actually happens with valid data.

See merge request !7
2015-07-13 14:57:07 -04:00
Andrew Tomaka da37a057cb Downcasing emails actually happens with valid data 2015-07-13 14:53:44 -04:00
Andrew Tomaka dd69e9a89b Merge branch 'atomaka/feature/flash-messages' into 'master'
Add flash notices

Add ability to serve flash messages and add them for sign in, sign out, and sign up.

See merge request !6
2015-07-10 16:46:31 -04:00
Andrew Tomaka 1abbdbac12 Add flash notices for sign in, sign out, sign up 2015-07-10 16:21:59 -04:00
Andrew Tomaka f91390baf6 Merge branch 'atomaka/feature/sessions' into 'master'
Add user sessions

Although rails provides built-in user sessions, this allows us to add additional fields to the session model. For example, we can now track the user agent and IP address of all sessions associated with a user.  Long term, this allows us to do neat things like session revocation (by both user and admin) and sudo mode.

See merge request !5
2015-07-10 14:59:45 -04:00
Andrew Tomaka 3308cfc1c1 Add user sessions 2015-07-10 14:33:39 -04:00
Andrew Tomaka 1bda41e83a Merge branch 'atomaka/feature/testing-metrics' into 'master'
Add metrics for testing / style / best practices

Bad rebase in PR !2? perhaps.  This readds some of the stuff that was missing.

See merge request !4
2015-07-10 00:28:33 -04:00
Andrew Tomaka 6708b4a501 Add metrics for testing / style / best practices 2015-07-10 00:27:23 -04:00
Andrew Tomaka 29600b12a3 Merge branch 'atomaka/feature/layout' into 'master'
Layout updates

We basically are reddit now

See merge request !3
2015-07-09 23:50:22 -04:00
Andrew Tomaka 790cb26f2a We basically are reddit now 2015-07-09 23:47:34 -04:00
Andrew Tomaka 80af796096 Merge branch 'atomaka/feature/users' into 'master'
Add user creation

Adds simple creation of users that have a username, password, and an email.  The password is managed by Rail's `has_secure_password`.

See merge request !2
2015-07-09 16:39:04 -04:00
Andrew Tomaka 8344498740 Add user creation 2015-07-09 16:31:41 -04:00
Andrew Tomaka 6fee16e22a Merge branch 'atomaka/feature/testing-development-setup' into 'master'
Initial Gems and Setup

Install necessary gems and set them up appropriately.  Mainly testing environment and design type stuff.

See merge request !1
2015-07-08 15:06:03 -04:00
Andrew Tomaka 0c0c128f5e Development and testing setup 2015-07-08 14:51:49 -04:00
Andrew Tomaka b6ec589f33 Initial commit 2015-07-08 10:24:41 -04:00