On 3. juni. 2009, at 05.47, prlawrence wrote:
> In the meantime, is there a way I can create teams from the command
> line? Some sort of rake command or somesuch? That would at least get
> me ready to demo the tool even if I didn't figure out the team
> creation page problem yet.
Sure!
Rails comes with a console for working with your models. Fire it up
like so
RAILS_ENV=<your-env> ruby script/console
This gives you an interactive Ruby shell with your Rails environment
loaded. From here you can:
me = User.find_by_login '<your_login>' # substitute with your
login
on your installation of Gitorious
my_team = Group.new
my_team.name = 'footeam' # or whatever
my_team.description = 'Some wordy description here'
my_team.creator = me # Every team
has a creator, in this case
this would be you
my_team.save!
As you can see, you're working with your database, but through Active
Record (Rails' ORM). Although using a SQL shell is possible, using the
script/console is more comfortable and maintains the relationships the
way they're supposed to be.
Regards,
- Marius
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Gitorious" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/gitorious?hl=en
-~----------~----~----~----~------~----~------~--~---