nejdetkadir / followability Goto Github PK
View Code? Open in Web Editor NEWImplements the social network followable functionality for your Active Record models
License: MIT License
Implements the social network followable functionality for your Active Record models
License: MIT License
Hi, i've got a question regarding the callback functions.
1) callback definition
In the readme it states the usage is like this:
def follow_request_accepted_by_me(record); end
but the run_callback method in callbacks.rb seems to run the callback method with two parameters?
2) callback parameter
from the readme file i thought i would always get the other model of the follow relationship in the callback as parameter,
but i guess i dont?
which i think translate to:
=> user_a.follow_request_accepted_by_me(user_a, :follow_request_accepted_by_me)
is this intentional? I would have expected something like this:
run_callback(self, affected: record, callback: :follow_request_accepted_by_me)
=> user_a.follow_request_accepted_by_me(user_b, :follow_request_accepted_by_me)
If it's not intentional I could try to make a pull request ๐
Example
@bar = nil
@foo.following?(@bar) -> false
Line 51 of follow.rb:
relation = followerable_relationships.find_by(followable_id: record.id,
followable_type: record.class.name,
status: Followable::Relationship.statuses[:following])
Changed to:
relation = followerable_relationships.find_by(followable_id: record.id,
followable_type: record.class.name,
status: Followability::Relationship.statuses[:following])
I was then able to unfollow users.
This should be the inverse of the blocks the same as following/followers are inverse of each other.
Hello,
I am considering using the followability gem for a Rails project that uses Mongoid as its database ODM instead of ActiveRecord. I was wondering if it is possible to integrate followability with Mongoid, and if so, how one might go about doing this. Any guidance or suggestions on modifications that might be required to support Mongoid would be greatly appreciated.
Thank you for your help!
Best Regards.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.