This is a fork of the Forem gem, used in the implementation of forums in Electorate.me
Inside Electorate.me, Forem uses Redis to save the Forem::Category ID's used in the basic categories. Also, it saves the ID for the Forem::Group used for Moderators
Redis is initialized in config/initializers/redis.rb
as $redis
, in the Electorate.me app.
To retrieve the basic ID's used in Forem, the following method is used:
$redis.get('key_of_the_id_stored')
Currently, the keys stored are:
communities_category_id
leaders_category_id
general_category_id
moderators_group_id
For example, to retrieve the ID for the Leaders category, you use $redis.get('leaders_category_id')
Initializing forem is easy!
First, initialize Forem's basics (categories and moderator's group):
bundle exec rake forums:initialize
This command takes the Leadership Positions of every Movement and creates a forum for each one, inside
bundle exec rake forums:create_leaders
This command creates the Category forums for each Movement according to its Scope
bundle exec rake forums:create_communities
This command imports the Leadership Users which state is Active of each Movement and recognizes them as Moderators of the Movement's forum
bundle exec rake forums:create_moderators
This command destroys every Forum, Category, Group of the database
bundle exec rake forums:clear
##Setting a user as Superadmin ('Access Denied' message)
If you try to access the Admin Area and the message Access Denied pops up, it's necessary to set the user as Superadmin.
To do this, access the Rails Console in the server and find the User, then set its attribute forem_admin
to true and save
the User.
These are the basic Forem's methods implemented in the User model:
forem_name
forem_email
forem_moderator(movement)