Code Monkey home page Code Monkey logo

followability's Introduction

followability's People

Contributors

ch000 avatar nejdetkadir avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

followability's Issues

Question regarding callbacks

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?

record.send(cb_name, affected, cb_name) if record.respond_to?(cb_name)

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?

run_callback(self, affected: self, callback: :follow_request_accepted_by_me)

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 ๐Ÿ‘

Unfollow not working

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.

Compatibility with Mongoid

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.

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.