Peter, here's a short description of some useful things to know that
will help you:
First of all let introduce the concept of a RAILS_ROOT directory. This
is the top level directory of your Community Engine application. You
will see within it directory names like app, config, db, log, lib,
public and so forth. Set your current working directory to be this
directory from within a terminal (command line) window.
From this directory you can do a number of things via the command line.
So to answer your first question about how to create an admin user type
something like this:
rake community_engine:make_admin email=
pdbe...@gmail.com
If you need to activate the user that is easy too. You have two options:
read your log file in the log directory and you will find a copy of the
email message that failed to get sent to you. Copy/paste the URL for
activation from it.
The alternative is to use the rails console. This is a great way to do
quick things or to validate your code theories before committing code
changes to source control.
rails console
irb(main):001:0>
The above starts up the rails console and shows the prompt that you get.
You can now fetch a user record. There are many possible ways but the
basic method is:
u = User.find 1
This will fetch the user record from the DB having id value of 1. That's
probably the new account that you just made. Now you can operate on u to
change the user record. A user record is activated when it has a valid
date/time stored. Here's how you do that:
u.activated_at = DateTime.now
You then need to save your change to the DB like this:
u.save
If in the future you need reset a password on a user account you would
first fetch the account record. In that case you might know the user's
email address and so you could fetch the account like this:
u = User.find_by_email '
pdbe...@gmail.com'
Then you can change their password like this:
u.password = u.password_confirmation = 'the new password'
u.save
I hope this helps!
Dan
> --
> You received this message because you are subscribed to the Google
> Groups "CommunityEngine" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
communityengi...@googlegroups.com.
> To post to this group, send email to
communi...@googlegroups.com.
> Visit this group at
http://groups.google.com/group/communityengine.
> For more options, visit
https://groups.google.com/groups/opt_out.