{"id":20426015,"url":"https://github.com/dfischer/fischyfriends","last_synced_at":"2025-04-12T19:02:56.595Z","repository":{"id":386469,"uuid":"3863","full_name":"dfischer/fischyfriends","owner":"dfischer","description":"A fischy(sic) version of a friend system","archived":false,"fork":false,"pushed_at":"2008-08-03T09:25:42.000Z","size":90,"stargazers_count":42,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-26T13:12:26.262Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://www.danielfischer.com","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dfischer.png","metadata":{"files":{"readme":"README.textile","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2008-03-14T10:33:48.000Z","updated_at":"2023-10-02T06:29:36.000Z","dependencies_parsed_at":"2022-07-14T12:01:45.354Z","dependency_job_id":null,"html_url":"https://github.com/dfischer/fischyfriends","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfischer%2Ffischyfriends","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfischer%2Ffischyfriends/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfischer%2Ffischyfriends/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfischer%2Ffischyfriends/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dfischer","download_url":"https://codeload.github.com/dfischer/fischyfriends/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248618276,"owners_count":21134200,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T07:15:01.046Z","updated_at":"2025-04-12T19:02:56.553Z","avatar_url":"https://github.com/dfischer.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"h1. Fischyfriends\n=============\n\nPre-productioon plugin released to the public.\n\nThe basic idea is that there are two classes of users.\n\nFans, and mutual fans. If two people are fans, they are mutual fans, and thereby in my definition, friends.\n\nMake sure you create a friendship model and this migration:\n\n\u003cpre\u003e\n  \u003ccode\u003e\n    class CreateFriendships \u003c ActiveRecord::Migration\n      def self.up\n        create_table :friendships do |t|\n          t.integer  \"user_id\",    :null =\u003e false\n          t.integer  \"friend_id\",  :null =\u003e false\n          t.datetime \"created_at\" \n          t.datetime \"updated_at\"\n          t.timestamps\n        end\n        add_index :friendships, :user_id\n        add_index :friendships, :friend_id\n      end\n\n      def self.down\n        drop_table :friendships\n      end\n    end\n  \u003c/code\u003e\n\u003c/pre\u003e\n\n\n\u003cpre\u003e\n  \u003ccode\u003e\n    #friendship.rb\n    \n    class Friendship \u003c ActiveRecord::Base\n      belongs_to :friendshipped_by_me,   :foreign_key =\u003e :user_id,   :class_name =\u003e \"User\"\n      belongs_to :friendshipped_for_me,  :foreign_key =\u003e :friend_id, :class_name =\u003e \"User\"\n    end\n  \u003c/code\u003e\n\u003c/pre\u003e\n\n\n\nAlso add this in your user model:\n\n\u003cpre\u003e\n  \u003ccode\u003e\n    #user.rb\n    \n    acts_as_fischyfriend\n  \u003c/code\u003e\n\u003c/pre\u003e\n\n\n\n\nh1. RSpec Example\n=======\n\n\u003cpre\u003e\n  \u003ccode\u003e\n    require File.dirname(__FILE__) + '/../spec_helper'\n\n    describe Friendship do\n     before(:each) do\n       @friendship = Friendship.new\n     end\n\n     it \"should be valid\" do\n       @friendship.should be_valid\n     end\n    end\n\n    describe Friendship, \"between two users\" do\n     fixtures :users\n\n     before(:each) do\n       @quentin = users(:quentin)\n       @bob = users(:aaron)\n       @wtf = User.create!(:login =\u003e 'a_user', \n                           :password =\u003e 'password', \n                           :password_confirmation =\u003e 'password', \n                           :email =\u003e 'poop@poop.com')\n     end\n\n     it \"should acknowledge there is a friendship between them\" do\n       @bob.add_friend @quentin\n       @bob.add_friend @wtf\n       @quentin.add_friend @bob\n\n       @bob.reload\n\n       @bob.is_a_fan_of.should include(@wtf)\n       @bob.is_a_fan_of.should_not include(@quentin)\n\n       @bob.pending_mutual_friends.should include(@wtf)\n       @bob.pending_mutual_friends.should_not include(@quentin)\n\n       @wtf.mutual_friends.should be_empty\n       @wtf.fans_of_me.should include(@bob)\n\n       @quentin.reload\n       @quentin.mutual_friends.should include(@bob)\n       @quentin.mutual_friends.should_not include(@wtf)\n\n       @quentin.destroy_friendship_with @bob\n       @quentin.reload\n       @quentin.friends_by_me.should_not include(@bob)\n\n     end\n\n     it \"should be able to tell you if two people are mutual friends\" do\n       @bob.add_friend @quentin\n       @bob.add_friend @wtf\n       @quentin.add_friend @bob\n       @bob.is_mutual_friends_with?(@quentin).should eql(true)\n       @bob.is_mutual_friends_with?(@wtf).should eql(false)\n     end\n    end\n  \u003c/code\u003e\n\u003c/pre\u003e\n\nh1. Changelog\n=======\n\n*August 3, 2008*\n*  Accepted changeset  \"868bc\":http://github.com/pogopuffin/fischyfriends/commit/868bc89db99fb52385028b9679eb917548a447b6 by pogopuffin\n*  Added in specs against above changeset\n* Tested against Rails 2.1.0 w/ passes\n* Updated migration example with indexes, is this wise? I'm not a database wiz here.\n\n*March 14, 2008*\n* First Release\n\nCopyright (c) 2008 [Daniel Fischer] / http://www.danielfischer.com, released under the MIT license\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfischer%2Ffischyfriends","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdfischer%2Ffischyfriends","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfischer%2Ffischyfriends/lists"}