Coder Social home page Coder Social logo

kvnlay / facemash Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 303 KB

A social media app built with ruby on rails. It includes some of the core features of the facebook app which includes; users, friendships, posts, liking, comments, etc.

Home Page: https://shrouded-refuge-15460.herokuapp.com/

Ruby 62.69% JavaScript 1.21% CSS 0.57% HTML 27.45% CoffeeScript 1.18% SCSS 6.75% Shell 0.15%

facemash's Introduction

kvnlay

My Github page

facemash's People

Contributors

cena-jm avatar kvnlay avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

bellom

facemash's Issues

[Accepting friend request doesn't make the two friends]

I think we need to fix your implementation of creating friendships out of an existing friend_request.

Steps to recreate:

  1. Create two users - ryto and jim
  2. Run jim.sent_requests.create(requested_id: ryto.id)
  3. Run ryto.friends -> Shows jim in it.
  4. Run jim.friends -> Shows empty array.

image

This means

remove_friend method in user model using current_user method

This method is using another method inside it which the User model is unable to access. In the console I am trying to do the ff:

ryto.remove_friend(first) -> ryto and first are users I created and they are friends

But this results in the ff:

image

I also figured you didn't include this remove_friend method in your user_spec.rb specs. So yes we should also test this.

Two friendship records created for every user becoming friends with another

Hi,

I didn't right away realize this but since for the past projects I've reviewed this has been happening. I was wondering if you can refactor the way you generate friendship records in the database:

ryto.friendships.create(friend_id: first.id) and then running Friendship.all shows:

image

I recognize that this is due to the create_mutual_friendship method you have in your Friendship model. However, doing it like this can easily fill up the database with unnecessary records. What we want is just to record a friendship once (and in fact enforcing uniqueness in the friendship between two users).

A way to do this is to keep track of which user adds the other. Similar to how you did it with FriendRequest (in here for every request made there is only one record generated).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.