Make the invitation function plugable.
- Host application must has
API::CurrentUserHelper
module with methodcurrent_user
avaiable. User
model 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 betrue
orfalse
. - Each user has a uniq
id
andopenid
. - Only
zh-CN
translation is supported. Pingpp
gem is mandatory for payment implementation. Andpingpp_app_id
needs to be configured.- User has a method
phone
which 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:
$ bundle
Run install generator
$ bundle exec rails g rails_invitable:install
rake db:migrate
may fail because of wrong rails version, got to the migrations and fix the files manually.
bundle exec rails test
The gem is available as open source under the terms of the MIT License.