Make the invitation function plugable.
- Host application must has
API::CurrentUserHelpermodule with methodcurrent_useravaiable. Usermodel must exists, but the name of the model can be configured.- User instance should be able to respond to public method
admin?, the result should betrueorfalse. - Each user has a uniq
idandopenid. - Only
zh-CNtranslation is supported. Pingppgem is mandatory for payment implementation. Andpingpp_app_idneeds to be configured.- User has a method
phonewhich can get its phone number.
User will have a new column with attribute red_pocket. Which holds the information of his remaining red_pocket money.
# config/initializer/rails_invitable.rb
RailsInvitable.user_class = "User" # Or other user class name used in your project. Should be a string or symbol.Add this line to your application's Gemfile:
gem 'rails_invitable', :git => 'git://github.com/aihehuo/rails-invitable.git'And then execute:
$ bundleRun install generator
$ bundle exec rails g rails_invitable:installrake db:migrate may fail because of wrong rails version, got to the migrations and fix the files manually.
bundle exec rails testThe gem is available as open source under the terms of the MIT License.