Giter Site home page Giter Site logo

charlotte-ruby / social_engine Goto Github PK

View Code? Open in Web Editor NEW
45.0 45.0 7.0 173 KB

Alpha - Basic social functions like friendships, comments, ratings, favorites, etc..

License: MIT License

Ruby 59.35% JavaScript 4.70% HTML 9.14% CSS 13.72% Gherkin 9.40% Haml 3.70%

social_engine's People

Contributors

dependabot[bot] avatar invalidusrname avatar jaymcaliley avatar johnmcaliley 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

Watchers

 avatar  avatar  avatar

social_engine's Issues

Is it possible to safely reopen models within social_engine

This seems like standard ruby stuff but for something reason I'm getting mixed results when I try to "monkey patch" Comment class. What's weird is that it works perfectly fine for the Friending class. Examples:

require 'friending'
class Friending < ActiveRecord::Base
  def follow
    friendor.follow(friendee)
  end
end

The above works without a hitch. However if I try to reopen the Comment model for example:

require 'comment'
class Comment < ActiveRecord::Base
  include SearchResult
end

I get an endless array of errors starting ith undefined method is_votable. I suspect this has something to do with the initialization and the fact that the commentable, votable, etc. stuff is added via the AR extension initializer and is called before deprecated routes but I don't understand why this is affecting me.

class Engine < Rails::Engine
    initializer 'social_engine.ar_extensions', :before=>"action_controller.deprecated_routes" do |app|
      ActiveRecord::Base.extend SocialEngine::Voteable
      ActiveRecord::Base.extend SocialEngine::Commentable
      ActiveRecord::Base.extend SocialEngine::Rateable
      ActiveRecord::Base.extend SocialEngine::Favoriteable
      ActiveRecord::Base.extend SocialEngine::Reputatable
      ActiveRecord::Base.extend SocialEngine::Friendable
      ActiveRecord::Base.extend SocialEngine::Sociable
      ActiveRecord::Base.extend SocialEngine::SocialUser      
    end

Is there something special I need to do to reopen this class given this init logic

Thanks

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.