On Thu, Mar 10, 2011 at 7:53 PM, Renato Isidio <renato...@gmail.com> wrote:

> Its me again! it looks a simple question but I didnt find anywhere.
> How can we add a committer to a repository using rails console?
>
> I`ve got the repository, but I didnt find any method to do it. Is
> there a way?
>

What you want to do is to create a Committership object, this is what links
a repository with a "committer" (either a User or a Group). A Committership
needs these properties:
- a repository, obviously
- a creator (the user who made the object)
- a committer - either a User or Group
- a permissions property, which is a bit mask

This could be achieved as such in the console:

me = User.find_by_login("big_honcho")
repo = Repository.find(42)
mister_hagen = User.find_by_login("consigliere")
committership = repo.committerships.build(:creator => me, :committer =>
mister_hagen)
committership.build_permissions :commit, :admin
committership.save


> PS: Is there some kind of API for those gitorious classes?
>

There are quite a lot of test cases that are both intended to ensure things
keep working when we make changes and - more importantly - to demonstrate
the usage of Gitorious from a programmer's point of view.

Happy hacking!
- Marius

-- 
To post to this group, send email to gitorious@googlegroups.com
To unsubscribe from this group, send email to
gitorious+unsubscr...@googlegroups.com

Reply via email to