charlotte-ruby / social_engine Goto Github PK
View Code? Open in Web Editor NEWAlpha - Basic social functions like friendships, comments, ratings, favorites, etc..
License: MIT License
Alpha - Basic social functions like friendships, comments, ratings, favorites, etc..
License: MIT License
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
Error is caused by this:
redirect_to :back
need to investigate
Convert Social Engine for use with MongoDB? what database design changes needed?
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.