Best Approach for Implementing Groups

14 views
Skip to first unread message

Levi Rosol

unread,
Nov 19, 2008, 10:27:28 PM11/19/08
to CommunityEngine
So one of the next steps I need to take with CE is to implement some
sort of Group functionality. The idea is that any user can create a
Group. A Group will have nearly all of the same functionality that a
User has in terms of a profile, comments, photos, friends (but called
members), etc..

What are your thoughts on the best way to approach building this? I
think because of how tightly everything is tied to the existing User,
the only route to go with this is to create a new model from scratch
and do a lot of copy/pasting to bring over the existing User
functionality.

Got a better way? Cause this doesn't seem very DRY.

sachin kale

unread,
Nov 19, 2008, 10:54:09 PM11/19/08
to communi...@googlegroups.com
I have implemented projecting a group as a 'user'
You can have a seperate model for relationship between group and subscribers -> membership, which has group_id(i.e user_id projected as group) and user_id(subscriber to the group)
This way we can have all the features for the group that are available to user.
like group blog/photos/comments/home-page etc.
--
Sachin Kale


Levi Rosol

unread,
Nov 19, 2008, 11:02:37 PM11/19/08
to communi...@googlegroups.com
Will that allow a User and a Group to have different functionality if required? for example, lets say you didn't want a group to have a Photo Gallery.

Levi Rosol

sachin kale

unread,
Nov 19, 2008, 11:09:47 PM11/19/08
to communi...@googlegroups.com
You can do that, cut off all the photo functionality from views (show method of user, photos)

For convenience you can add user_type to user model , this will have value "group" for group.
Based on this user.user_type you can decide what functionality should be provided.

Or write a :before_filter , like - "usertype_user_required" in that filter you can check for user_type.
--
Sachin Kale


Levi Rosol

unread,
Nov 19, 2008, 11:41:51 PM11/19/08
to communi...@googlegroups.com
Ok, that makes sense. If I'm understanding you correctly, you're basically talking about Single Table Inheritance (http://wiki.rubyonrails.org/rails/pages/singletableinheritance).

So then to define some sort of ownership of a group, you'd simply add some sort of FK to the User model, like Manager_User_Id ?  I suppose though, in my case though, I'd have a cross ref table because we will need the ability to have more than one manager for a group, and a single user could manage more than one group.

has_many :groups, :through => :user_group

But then what about a role based system? ie: manager, moderator, etc I'd want to keep that functionality separate from the current user/role setup because a single user may manage multiple groups.

Sorry, I'm rambling on here. Clearly I need to spend some more time defining the functionality I need before moving forward.  :-)
--
Levi Rosol

Twitter: @LeviRosol

sachin kale

unread,
Nov 19, 2008, 11:58:02 PM11/19/08
to communi...@googlegroups.com
On Thu, Nov 20, 2008 at 10:11 AM, Levi Rosol <levi....@gmail.com> wrote:
Ok, that makes sense. If I'm understanding you correctly, you're basically talking about Single Table Inheritance (http://wiki.rubyonrails.org/rails/pages/singletableinheritance).
I haven't read that and really don't know what it means.

So then to define some sort of ownership of a group, you'd simply add some sort of FK to the User model, like Manager_User_Id ?  I suppose though, in my case though, I'd have a cross ref table because we will need the ability to have more than one manager for a group, and a single user could manage more than one group.

has_many :groups, :through => :user_group

But then what about a role based system? ie: manager, moderator, etc I'd want to keep that functionality separate from the current user/role setup because a single user may manage multiple groups.

You can keep group-moderatorship as different model  , similar to forum moderatorship, which addresses requirement of user managing multiple groups. This separates it from group-membership.
I haven't done this, as my groups requirement did not had user-created/moderated groups but they were fixed groups having only user- memberships.




--
Sachin Kale


Bruno Bornsztein

unread,
Nov 20, 2008, 1:53:07 PM11/20/08
to communi...@googlegroups.com
Hey guys, just wanted to weigh in:

I'm not a fan of implementing Groups by doing inheritance/user_type on the User model, since they're essentially different objects, IMO. So I doubt this kind of implementation would be accepted back into CE (if submitted). I'd much prefer a new Group model with its own logic and views.

In fact, I'd suggest doing this as a CE plugin (basically, a plugin that relies on Engines and CE, implementing groups functionality). The plugin could have its own migrations, models, controllers and views, and just come with the requirement that you have CE installed as well. That way we can work out the kinks and then hopefully integrate it into the core.

Thanks, and good luck.
Bruno

Levi Rosol

unread,
Nov 20, 2008, 11:23:24 PM11/20/08
to communi...@googlegroups.com
Decisions decisions decisions. Bruno, the way you describe was my initial plan (independent m/v/c's). I wanted to build it in such a way so that it could be added to the CE core easily, but on the same hand, for my purposes, the base functionality of a group will be nearly the same as a user. However I will be extending it tremendously as the Group object is really what my application will be built around.

Also, I don't see myself building it as a plug-in for CE. My application consists of CE as it's base, and my custom stuff on top of it. I would prefer CE to be the app, not the plugin, but it does function the way it is. I don't want to burry my stuff in the plug-in though.

Based on the reading i've done, I think a clean line of separation can be kept by taking the STI approach. Basically add a 'type' field to the User model, then go from there. It may even be worth while to abstract out the base functionality that both models will share, and inherit from that for both User and Group.

Then comes the question of Group membership. In my scenario, Users have friends and groups have members. If two Users are members of the same Group, they would be colleagues. When a User views another Users profile, they would see the Users friends as you already have them, and would have a separate box for colleagues. That not exactly how it would work, but it gets the idea across that colleagues are different than friends.

So that could involve inheriting from the Friendship model for the Member model. And I guess in that case, it may make more sense to have a separate, clean cut Group as all of the friendship stuff in the current User model is null and void for a Group.

I'm starting to ramble again. Is this making sense?

I think I'm to the point to where I just need to jump in and do it, and if it can be re-used in CE great. Either approach can be added to CE. It just depends on how much refactoring someone is willing to do to get it in there.


--
Levi Rosol

Twitter: @LeviRosol



On Thu, Nov 20, 2008 at 12:53 PM, Bruno Bornsztein <bruno.bo...@gmail.com> wrote:
Hey guys, just wanted to weigh in:

I'm not a fan of implementing Groups by doing inheritance/user_type on the User model, since they're essentially different objects, IMO. So I doubt this kind of implementation would be accepted back into CE (if submitted). I'd much prefer a new Group model with its own logic and views.

In fact, I'd suggest doing this as a CE plugin (basically, a plugin that relies on Engines and CE, implementing groups functionality). The plugin could have its own migrations, models, controllers and views, and just come with the requirement that you have CE installed as well. That way we can work out the kinks and then hopefully integrate it into the core.

Thanks, and good luck.
Bruno
On Wed, Nov 19, 2008 at 10:58 PM, sachin kale <brigh...@gmail.com> wrote:
On Thu, Nov 20, 2008 at 10:11 AM, Levi Rosol <levi....@gmail.com> wrote:
Ok, that makes sense. If I'm understanding you correctly, you're basically talking about Single Table Inheritance (http://wiki.rubyonrails.org/rails/pages/singletableinheritance).
I haven't read that and really don't know what it means.

So then to define some sort of ownership of a group, you'd simply add some sort of FK to the User model, like Manager_User_Id ?  I suppose though, in my case though, I'd have a cross ref table because we will need the ability to have more than one manager for a group, and a single user could manage more than one group.

has_many :groups, :through => :user_group

But then what about a role based system? ie: manager, moderator, etc I'd want to keep that functionality separate from the current user/role setup because a single user may manage multiple groups.

You can keep group-moderatorship as different model  , similar to forum moderatorship, which addresses requirement of user managing multiple groups. This separates it from group-membership.
I haven't done this, as my groups requirement did not had user-created/moderated groups but they were fixed groups having only user- memberships.


Sorry, I'm rambling on here. Clearly I need to spend some more time defining the functionality I need before moving forward.  :-)



--
Sachin Kale








Bruno Bornsztein

unread,
Nov 20, 2008, 11:39:16 PM11/20/08
to communi...@googlegroups.com
Maybe what you want is a Profile object, a User object, and a Group object. Profile would contain the stuff shared by both, so a User and a Group would both have a profile, but a Group wouldn't have a birthday, like a user would.

Make sense?

sachin kale

unread,
Nov 20, 2008, 11:52:28 PM11/20/08
to communi...@googlegroups.com
That makes sense,
That would be a good addition to CE.

Also going further if it makes sense and is viable, I think we can have all the functionality attached to profile object like - photos/forums/blogs/friendship etc

For group, we can select forum/photos/(membership - friendship model  -  renamed in the view) etc
For user - photos/comments/blog/friendship etc.

The functionality selection for group/user can be decided from a config file. I am aware this would be huge task though but this would result in more flexibility.
--
Sachin Kale


Levi Rosol

unread,
Nov 21, 2008, 12:06:17 AM11/21/08
to communi...@googlegroups.com
eeekkk!!! config file! noooo!  :-p

no, but seriously, I like the idea of a profile, but maybe it makes sense to flip the functionality. User is the root object, has the basics like account info, then the Profile object has all of the other stuff like birthday, forum moderation, photos, etc.

The only problem i see there is that a group wouldn't have authentication. I would login as myself (a user with a profile) and i would manage the Groups i've created. I would never log in as the Group itself.

So maybe User gets stripped down to bare bones, and then a user can have one Profile and many Groups tied to it. When i first started building my application, this is what I did (although i hadn't built the Group yet) and it seemed like it was going to work well. Esentually all the User model had was username, password (salt, etc) and email. all other data, including forum moderation, photos, friends, etc. were associated to the Profile, not the user.

This would allow then for Groups to be tied to the User via User_Group and that cross ref could hold additional values like roles and what not.

I think this is a good discussion, but now i'm wondering, who's gonna make the call as to what gets done and how to CE? I'd love to contribute, but bare in mind, I'm a RoR noob, and am not confident enough to tackle this myself (that, and i don't understand the whole plugin concept).

Where can I help? What's the first step?


--
Levi Rosol

Twitter: @LeviRosol



On Thu, Nov 20, 2008 at 10:52 PM, sachin kale <brigh...@gmail.com> wrote:
That makes sense,
That would be a good addition to CE.

Also going further if it makes sense and is viable, I think we can have all the functionality attached to profile object like - photos/forums/blogs/friendship etc

For group, we can select forum/photos/(membership - friendship model  -  renamed in the view) etc
For user - photos/comments/blog/friendship etc.

The functionality selection for group/user can be decided from a config file. I am aware this would be huge task though but this would result in more flexibility.
On Fri, Nov 21, 2008 at 10:09 AM, Bruno Bornsztein <bruno.bo...@gmail.com> wrote:
Maybe what you want is a Profile object, a User object, and a Group object. Profile would contain the stuff shared by both, so a User and a Group would both have a profile, but a Group wouldn't have a birthday, like a user would.

Make sense?
On Thu, Nov 20, 2008 at 10:23 PM, Levi Rosol <levi....@gmail.com> wrote:
Decisions decisions decisions. Bruno, the way you describe was my initial plan (independent m/v/c's). I wanted to build it in such a way so that it could be added to the CE core easily, but on the same hand, for my purposes, the base functionality of a group will be nearly the same as a user. However I will be extending it tremendously as the Group object is really what my application will be built around.

Also, I don't see myself building it as a plug-in for CE. My application consists of CE as it's base, and my custom stuff on top of it. I would prefer CE to be the app, not the plugin, but it does function the way it is. I don't want to burry my stuff in the plug-in though.

Based on the reading i've done, I think a clean line of separation can be kept by taking the STI approach. Basically add a 'type' field to the User model, then go from there. It may even be worth while to abstract out the base functionality that both models will share, and inherit from that for both User and Group.

Then comes the question of Group membership. In my scenario, Users have friends and groups have members. If two Users are members of the same Group, they would be colleagues. When a User views another Users profile, they would see the Users friends as you already have them, and would have a separate box for colleagues. That not exactly how it would work, but it gets the idea across that colleagues are different than friends.

So that could involve inheriting from the Friendship model for the Member model. And I guess in that case, it may make more sense to have a separate, clean cut Group as all of the friendship stuff in the current User model is null and void for a Group.

I'm starting to ramble again. Is this making sense?

I think I'm to the point to where I just need to jump in and do it, and if it can be re-used in CE great. Either approach can be added to CE. It just depends on how much refactoring someone is willing to do to get it in there.









--
Sachin Kale





Max Schubert

unread,
Nov 21, 2008, 12:06:47 AM11/21/08
to communi...@googlegroups.com
On Thu, Nov 20, 2008 at 11:52 PM, sachin kale <brigh...@gmail.com> wrote:
> That makes sense,
> That would be a good addition to CE.
>
> Also going further if it makes sense and is viable, I think we can have all
> the functionality attached to profile object like -
> photos/forums/blogs/friendship etc
>
> For group, we can select forum/photos/(membership - friendship model -
> renamed in the view) etc
> For user - photos/comments/blog/friendship etc.
>
> The functionality selection for group/user can be decided from a config
> file. I am aware this would be huge task though but this would result in
> more flexibility.

I like this direction .. how about this?

* Each user always belongs to a group
* Each group has roles associated with it 'a.k.a' photos, comments, blogs, etc
* If a user is being created and added explicitly to a group at the
same time, they get the set of roles associated with that group.
* If a user is self-sign up, they get the roles assigned by the CE
admin associated with a global or default group .. the default group
would be created at CE setup time.
* For multiple groups, the user gets the functionality of a group when
acting on a group created resource .. or if they are acting on a
resource that is not owned by any of the groups they belong to, they
get the default/global set of roles.

Also a huge task, but adds a lot of possibilities going forward,
including then having heirarchical groups and provides a consistent
relationship model throughout the system.

- Max

Levi Rosol

unread,
Nov 21, 2008, 12:10:03 AM11/21/08
to communi...@googlegroups.com
sachin, sorry, i mis-read what you said. I thought you said "have all functionality attached to the USER".

so yeah, i think i just regurgitated what you said :-)

--
Levi Rosol

Twitter: @LeviRosol


Levi Rosol

unread,
Nov 21, 2008, 12:18:04 AM11/21/08
to communi...@googlegroups.com
Max-

I like where you're going with this, at least the hierarchy of groups part as that is ultimately where my application is heading.

I'm not sure I'm seeing the benefit of having a global group. Some people may want to use CE as it is today. Users and Friends with no need for Groups. Having a global Group seems to be added complexity.

Also, a Group will function differently than a User, or Profile as we started to describe earlier.

But am I understanding you correctly?

But back to your suggestion of having a way to build a hierarchy... This could be done pretty easily using a "Self Referential Many To Many Relationship" relation  (here).

Levi Rosol

On Thu, Nov 20, 2008 at 11:06 PM, Max Schubert <max.sc...@gmail.com> wrote:

Max Schubert

unread,
Nov 21, 2008, 12:31:17 AM11/21/08
to communi...@googlegroups.com
Hi Levi,

On Fri, Nov 21, 2008 at 12:18 AM, Levi Rosol <levi....@gmail.com> wrote:
> Max-
>
> I like where you're going with this, at least the hierarchy of groups part
> as that is ultimately where my application is heading.
>
> I'm not sure I'm seeing the benefit of having a global group. Some people
> may want to use CE as it is today. Users and Friends with no need for
> Groups. Having a global Group seems to be added complexity.
>
> Also, a Group will function differently than a User, or Profile as we
> started to describe earlier.
>
> But am I understanding you correctly?

I am seeing a group as an container for users and roles :), so it is
dual purpose, the global group just exists as a container for a
default set of roles so that the relationship model in this case would
be consistent and code wouldn't ahve to check to see if a user was in
a group or not in order to get roles for them .. does that clarify it
at all?

A profile can still be a 1-1 with a user, this just abstracts
functionality away from users and assigns it to a central class
(Group) that can act as both a way to associate users and a way to
associate roles .. all in one go.

So if a CE admin wanted to have no end user groups, that is fine :),
they just set up the roles for the global group and disable user
created groups and they are done.

This would also allow the CE overall admin to do varying levels of
administrative privileges using groups as well .. makes it easy to
make an admin who is just a forum/blog admin but who can't admin other
user profiles, or approve pending users if user signup moderation were
set up ... lets the CE admin create multi-level administration roles
for a CE instance.

- Max

Levi Rosol

unread,
Nov 21, 2008, 12:35:21 AM11/21/08
to communi...@googlegroups.com
forgive me if i'm being dense. I think what you're describing is a Group in a role based security sense. Meaning all users belong to a global group as a user, but then a CE admin could create another group, assign people to it, and give that group a role.

Is that correct?

--
Levi Rosol

Twitter: @LeviRosol


Max Schubert

unread,
Nov 21, 2008, 1:03:19 AM11/21/08
to communi...@googlegroups.com
On Fri, Nov 21, 2008 at 12:35 AM, Levi Rosol <levi....@gmail.com> wrote:
> forgive me if i'm being dense. I think what you're describing is a Group in
> a role based security sense. Meaning all users belong to a global group as a
> user, but then a CE admin could create another group, assign people to it,
> and give that group a role.
>
> Is that correct?

Both :). Both a mapping of associations between related users and
roles for that association.

Groups would be the mapping between users and roles. A group would
have one or more users and 1 or more roles associated with it, it
would also have optional end user visibility.

So "People who Love Orange" would be a group of users that would have
roles (able to post to the people who love orange forum, see all
orange lover member blogs, and be visible to end users within CE ..
while "Forum administrators" would be a group of users with a set of
roles that would allow users in that group to moderate forums but
would not be end user visible ... only admins would see it.

A boolean attribute on the group class could indicate whether the
group is for end users or is an administrative role group.

At the RDBMS this could map to group table, user table, role table,
group_role table, and user_group table.

I helped implement a custom system years ago in java that had a
user/group/role object model very similar to this.

Not saying it is ideal for CE or the right path for CE now, but it is
a very flexible model that would give the end CE user many options for
customization ...

Levi Rosol

unread,
Nov 21, 2008, 2:29:59 AM11/21/08
to communi...@googlegroups.com
Attached is a PDF I slapped together tonight giving a rough idea of the structure of what we described in this thread.

Couple things to note:

The existing Roles (think of these as system roles) get tied to a user via a Permissions table. This isn't necessary for the discussion at hand, but could be further expanded to cover what Max is talking about.

User drops a number of fields. All of which get moved to Profile. Some of which also end up in Group.

Relationships is the current Friendships model renamed. Added a 'type' field and a group_id and profile_id. This would allow Relationships to handle Friends for the Profiles and Members for the Groups using the single table inheritance (STI) pattern.

Although it's not on this diagram, it would be possible to create security at the Relationship level if needed. On the Group side, think of a Group Admin, Moderator, ??? roles. I'm not sure this is needed on the Profile side, so there wouldn't be a need to implement it. But the option is always there. This would further expand the functionality described by Max.

One thing that is missing is the ability to create a Group under another Group. For the core, this isn't nesessary, but would be easy to add using a Self Referential Many To Many Relationship

Then I threw in the Photos model. I added a 'type' field to the model, and then the profile_id and group_id columns. As with Relationships, this would allow us to keep all data for both in one place, differentiating by the type, using the STI pattern

Forums/topics/post, blog, comments, would all tie to the appropriate model (either Profile or Group, or both) in a similar fashion as the Photos.

thoughts?


... I need sleep...

--
Levi Rosol

Twitter: @LeviRosol


CE_Groups_v2.pdf

Bruno Bornsztein

unread,
Nov 21, 2008, 8:14:42 AM11/21/08
to communi...@googlegroups.com
Hi guys, before things get too complicated, here's more of what I had in mind:


Profile is just a container for things that go on the profile page for a group or user, and has a polymorphic association (so it can be associated with anything, really). Users stay the same, group is a new object, and users belong to a group through a Membership, which also describes the users Role in the group (admin, moderator, member) via the existing Roles table.

Make sense?

Max Schubert

unread,
Nov 21, 2008, 10:21:37 AM11/21/08
to communi...@googlegroups.com
On Fri, Nov 21, 2008 at 8:14 AM, Bruno Bornsztein
<bruno.bo...@gmail.com> wrote:
> Hi guys, before things get too complicated, here's more of what I had in
> mind:
>
>
> Profile is just a container for things that go on the profile page for a
> group or user, and has a polymorphic association (so it can be associated
> with anything, really). Users stay the same, group is a new object, and
> users belong to a group through a Membership, which also describes the users
> Role in the group (admin, moderator, member) via the existing Roles table.
>
> Make sense?

Very nice :)

Levi Rosol

unread,
Nov 21, 2008, 12:45:36 PM11/21/08
to communi...@googlegroups.com
So how should we go about attacking this?

Levi

Levi Rosol

unread,
Nov 24, 2008, 4:40:01 PM11/24/08
to communi...@googlegroups.com
Anyone planning to jump on this? If not, i will, but i can't put any guarantees when it will be done as it will be a learning process for me throughout.

Levi

Bruno Bornsztein

unread,
Nov 25, 2008, 10:01:13 AM11/25/08
to communi...@googlegroups.com
I don't plan on working on it anytime soon (not high on my priorities list). Let me know when you make some headway, I'd love to check out the repo.
Thanks,
Bruno

Levi Rosol

unread,
Nov 25, 2008, 10:15:59 AM11/25/08
to communi...@googlegroups.com
I started last night and should have something to show soon. I'm trying to keep this initial run at this generic, and will worry about my project specific stuff after i send it to you.

Levi

Levi Rosol

unread,
Dec 2, 2008, 2:04:03 PM12/2/08
to communi...@googlegroups.com
So now i have the following models:

Group
Membership
GroupRole < Role
Group_Permission

Currently you can create a new Group. When you do, the current_user is added to the Membership collection and gets the Owner permission added.
The index view lists the Groups
When you view a group, you just see the Group info

Next on my plate is to build out the Group profile page. I'll post my updates as I have them.

Levi Rosol
Twitter: @LeviRosol

david

unread,
Dec 3, 2008, 7:19:42 AM12/3/08
to CommunityEngine
isn't this the beauty of Ruby? ... It enables you to extract common
behaviour into a module... I think the best way to go would be to see
what are the "profile" fields naming conventions. You then apply
these conventions to the models you need to display as a "profile" and
extract the common methods to a module which you include with some
acts_as_... macro (just to stay with readability and conventions...)

What do you think?

David
Message has been deleted

Levi Rosol

unread,
Dec 3, 2008, 12:24:42 PM12/3/08
to communi...@googlegroups.com
I should clarify that I'm building this to meet a need I have for my application. I hope that it can be used within CE in part or in whole. However, my knowledge of RoR is minimal and building this addition as a plug-in/module/etc is not in the scope of what I'm doing.

I do think that it will be pretty simple move for someone who has a better understanding of what the final structure needs to be. It's also a process I'd like to be involved with as a way to learn, but I don't think I'll be able to take ownership of that move.

Levi Rosol
Twitter: @LeviRosol

On Wed, Dec 3, 2008 at 10:09 AM, marcus.rosentrater <marcus.ro...@digitalscientists.com> wrote:

Correct me if I'm wrong, but it seems like this implementation of
groups will be in the core of CE, effecting models, shuffling fields.

Will this be backwards compatible?

Is anyone working on a plugin based implementation of groups? Where a
group feature can be added or removed?

This would be much more conducive to the purposes that we use
community engine.


On Dec 2, 2:04 pm, "Levi Rosol" <levi.ro...@gmail.com> wrote:
> So now i have the following models:
>
> Group
> Membership
> GroupRole < Role
> Group_Permission
>
> Currently you can create a new Group. When you do, the current_user is added
> to the Membership collection and gets the Owner permission added.
> The index view lists the Groups
> When you view a group, you just see the Group info
>
> Next on my plate is to build out the Group profile page. I'll post my
> updates as I have them.
>
> Levi Rosol
> Twitter: @LeviRosol
>
> On Tue, Nov 25, 2008 at 9:15 AM, Levi Rosol <levi.ro...@gmail.com> wrote:
> > I started last night and should have something to show soon. I'm trying to
> > keep this initial run at this generic, and will worry about my project
> > specific stuff after i send it to you.
>
> > Levi
>
> > On Tue, Nov 25, 2008 at 9:01 AM, Bruno Bornsztein <
> > bruno.bornszt...@gmail.com> wrote:
>
> >> I don't plan on working on it anytime soon (not high on my priorities
> >> list). Let me know when you make some headway, I'd love to check out the
> >> repo.
> >> Thanks,
> >> Bruno
>
> >> On Mon, Nov 24, 2008 at 3:40 PM, Levi Rosol <levi.ro...@gmail.com> wrote:
>
> >>> Anyone planning to jump on this? If not, i will, but i can't put any
> >>> guarantees when it will be done as it will be a learning process for me
> >>> throughout.
>
> >>> Levi
>
> >>> On Fri, Nov 21, 2008 at 11:45 AM, Levi Rosol <levi.ro...@gmail.com>wrote:
>
> >>>> So how should we go about attacking this?
>
> >>>> Levi
>

Bruno Bornsztein

unread,
Dec 3, 2008, 2:03:24 PM12/3/08
to communi...@googlegroups.com
Thanks Levi,
I'm glad your working on improving the codebase to suit your needs, and I'll definitely take a look at whatever you're willing to contribute back to see if it can be integrated into the core.
@marcus: backwards compatibility is a must for me (I've got production sites running on CE), so anything that makes it into core will be compatible.

Levi Rosol

unread,
Dec 6, 2008, 6:17:56 PM12/6/08
to communi...@googlegroups.com
So now I have location assignment and searching for groups functional.

Next up are photos and avatars. I have briefly looked at how the User is setup, and it appears that the User is tightly tied to the Photo model. What approach would you take in adding the same Photo functionality that a User has to Group?

IMO, getting this far, I haven't kept things as DRY as I had hoped, and it looks like this isn't going to be any better. Right now the path it appears I will take is to make a GroupPhoto model and basically duplicate the Photo model.

got a better way?


--
Levi Rosol
Twitter: @LeviRosol

Bruno Bornsztein

unread,
Dec 8, 2008, 10:24:27 AM12/8/08
to communi...@googlegroups.com
Check out the Asset class (also look at ClippingImage, which descends from Asset).

Alexis

unread,
Dec 10, 2008, 9:56:32 PM12/10/08
to CommunityEngine
Hi Levi,
Do you have an ETA for the next phase of this functionality? We now
realize that we really need this at IMspirit.com, too, and eagerly
await your news.
~ Alexis

On Dec 2, 11:04 am, "Levi Rosol" <levi.ro...@gmail.com> wrote:
> So now i have the following models:
>
> Group
> Membership
> GroupRole < Role
> Group_Permission
>
> Currently you can create a new Group. When you do, the current_user is added
> to the Membership collection and gets the Owner permission added.
> The index view lists the Groups
> When you view a group, you just see the Group info
>
> Next on my plate is to build out the Group profile page. I'll post my
> updates as I have them.
>
> Levi Rosol
> Twitter: @LeviRosol
>
> On Tue, Nov 25, 2008 at 9:15 AM, Levi Rosol <levi.ro...@gmail.com> wrote:
> > I started last night and should have something to show soon. I'm trying to
> > keep this initial run at this generic, and will worry about my project
> > specific stuff after i send it to you.
>
> > Levi
>
> > On Tue, Nov 25, 2008 at 9:01 AM, Bruno Bornsztein <
> > bruno.bornszt...@gmail.com> wrote:
>
> >> I don't plan on working on it anytime soon (not high on my priorities
> >> list). Let me know when you make some headway, I'd love to check out the
> >> repo.
> >> Thanks,
> >> Bruno
>
> >> On Mon, Nov 24, 2008 at 3:40 PM, Levi Rosol <levi.ro...@gmail.com> wrote:
>
> >>> Anyone planning to jump on this? If not, i will, but i can't put any
> >>> guarantees when it will be done as it will be a learning process for me
> >>> throughout.
>
> >>> Levi
>
> >>> On Fri, Nov 21, 2008 at 11:45 AM, Levi Rosol <levi.ro...@gmail.com>wrote:
>
> >>>> So how should we go about attacking this?
>
> >>>> Levi
>

Levi Rosol

unread,
Dec 11, 2008, 12:09:00 AM12/11/08
to communi...@googlegroups.com
As of right now groups can be created, a location assigned, photos and avatars uploaded, and can be searched on by name and location. Activities are also functional, so you see things like "levi created a new group" in the "what's fresh" section of your pages. There are also grouproles, and i currently have the Owner role functional.

My next task is implementing membership functionality (and role), then comments.


All of this has been kept generic with the intent of giving back to CE. However, I'm not confident that i have done this in the best was for the CE core for a few reasons that i see. First, i'm a Rails noob :-) because of this, everything new that I have created has gone into my app folder, not the CE plugin. second, I have duplicated many pieces of functionality. For example, to get photos tied to a group, i literally copy/pasted the photo model, renamed to groupphoto in my app folder, and esentually did a find replace on user for group. I'm not saying that this won't work, because it will, I'm just not personally happy with the code structure. it is very very dirty IMO. Really, it's more un-DRY than dirty.

The second reason is, i have no idea how to merge my stuff into CE's git repos. This is probably minor, but it will require work on bruno's part.

On the positive, merging into the CE core should be easy as i have commented every place in the CE core that i have modified or added to consistently. I have also took the time to use the multi-ligual tags, so renaming labels throught the new views should be easy.

I'm not sure what my plan is for memberships yet. i could go the route of extending the existing friendship model, or i could go the route of making new models as this would provide cleaner separation.

For comments, i think that one is clear in that i'll add onto the existing model. A comment is a comment.



All of this said, now may be a good time for me to package up what I have and send to bruno before i start on anything else.

Bruno, got any thoughts on this? I can continue on and we can clean up later. Or, we can clean now, and do, hopefully, less clean up later.

As for a timeline, it is my goal to have my site lauched with the functionality described above by the end of the year. I think that is very realistic, however, i cannot make any promises for your site.

--
Levi Rosol
Twitter: @LeviRosol

Bruno Bornsztein

unread,
Dec 11, 2008, 9:56:39 AM12/11/08
to communi...@googlegroups.com
Hi Levi,
I'd be happy to take a look at what you have now, although the best solution would be for you to put your work up on github (or some other scm) so everyone can have a look. This is for two reasons:
1) If this work is compatible with CE core, I may not get around to integrating it for a while, someone else might get to it faster
2) Even if it doesn't go into the core, others could use your work as a starting point for doing their own groups implementation

If you're worried about putting your entire app out there, you could just share the relevant portions.

Thanks,
Bruno

Levi Rosol

unread,
Dec 11, 2008, 10:30:26 AM12/11/08
to communi...@googlegroups.com
What is the process for me adding it to github? I currently use svn for my scm, and won;t be able to open it up for others to use.

I am going to spend some time on it this weekend, and will work to get my additions moved to the CE plugin folder. There's really no reason for these to live in my app folder for now.


--
Levi Rosol
Twitter: @LeviRosol


Bruno Bornsztein

unread,
Dec 11, 2008, 12:57:22 PM12/11/08
to communi...@googlegroups.com
You'd need to install git on your machine, sign up for an account at github, and push your local repository to github. There's a bit of a learning curve with git, but it's well worth it (IMO).

http://git-scm.com/

Levi Rosol

unread,
Dec 15, 2008, 10:23:37 AM12/15/08
to communi...@googlegroups.com
good news. groups now have all of the functionality a user would have. membership has been implemented, photos, and comments. I will spend this week cleaning up a few things, but am planning to move everything that should be in the CE core into the CE plugin and will then ask for someone to help me get the code into the git repos.

What are the testing requirements for code in this project? At this point, i've written zero tests for the new functionality. partly due to me wanting to use rspec instead of ::test, but mostly because I don;t have anyone looking over my sholder saying "where's your test at levi?"  :-)




--
Levi Rosol
Twitter: @LeviRosol


Carl Fyffe

unread,
Dec 15, 2008, 10:45:49 AM12/15/08
to communi...@googlegroups.com
Where's your test Levi? *chuckle* Hope that helps.

CE is using Test::Unit

Bruno Bornsztein

unread,
Dec 15, 2008, 10:47:21 AM12/15/08
to communi...@googlegroups.com
More tests = better.
It's very hard for me to add big pieces of functionality to CE and make sure they're bug free without having good test coverage. Last I checked CE's test coverage was around 90%, so that's a good number to shoot for.

Alexis

unread,
Jan 2, 2009, 11:30:58 AM1/2/09
to CommunityEngine
Happy New Year, Everyone!!!

How is the testing for Groups coming? We are holding our breath,
here :-)

~ Alexis

On Dec 15 2008, 7:47 am, "Bruno Bornsztein"
<bruno.bornszt...@gmail.com> wrote:
> More tests = better.
> It's very hard for me to add big pieces of functionality to CE and make sure
> they're bug free without having good test coverage. Last I checked CE's test
> coverage was around 90%, so that's a good number to shoot for.
>
> On Mon, Dec 15, 2008 at 9:45 AM, Carl Fyffe <carl.fy...@gmail.com> wrote:
>
> > Where's your test Levi?  *chuckle* Hope that helps.
>
> > CE is using Test::Unit
>
> > On Mon, Dec 15, 2008 at 10:23 AM, Levi Rosol <levi.ro...@gmail.com> wrote:
> > > good news. groups now have all of the functionality a user would have.
> > > membership has been implemented, photos, and comments. I will spend this
> > > week cleaning up a few things, but am planning to move everything that
> > > should be in the CE core into the CE plugin and will then ask for someone
> > to
> > > help me get the code into the git repos.
>
> > > What are the testing requirements for code in this project? At this
> > point,
> > > i've written zero tests for the new functionality. partly due to me
> > wanting
> > > to use rspec instead of ::test, but mostly because I don;t have anyone
> > > looking over my sholder saying "where's your test at levi?"  :-)
>
> > > --
> > > Levi Rosol
> > > Twitter: @LeviRosol
>
> > > On Thu, Dec 11, 2008 at 11:57 AM, Bruno Bornsztein
> > > <bruno.bornszt...@gmail.com> wrote:
>
> > >> You'd need to install git on your machine, sign up for an account at
> > >> github, and push your local repository to github. There's a bit of a
> > >> learning curve with git, but it's well worth it (IMO).
>
> > >>http://git-scm.com/
>
> > >> On Thu, Dec 11, 2008 at 9:30 AM, Levi Rosol <levi.ro...@gmail.com>
> > >>>> On Wed, Dec 10, 2008 at 11:09 PM, Levi Rosol <levi.ro...@gmail.com>

Levi Rosol

unread,
Jan 5, 2009, 2:20:52 PM1/5/09
to communi...@googlegroups.com
Alexis-

Sorry it took a while to get back to you (and the group). Took some time off an tried to stay away from email and code as much as i could. :-)

I did spend some time getting a small number of tests in place, and am now going to start moving the Group functionality into the CE plugin itself (instead of my app).

I'll keep the group posted as i progress.


--
Levi Rosol
Twitter: @LeviRosol


Alexis

unread,
Jan 6, 2009, 5:13:36 PM1/6/09
to CommunityEngine
This is great news again, Levi. I hope you had a wonderful holiday and
I commend your staying away from code and email. I did much the same,
but I watched this thread because it is something quite important to
us. However, we don't want to rush a good thing, just want to know how
things are coming along. :-)

All the very best,
~ Alexis
> ...
>
> read more »

jdutil

unread,
Jan 25, 2009, 1:26:40 PM1/25/09
to CommunityEngine
Yeah I'm also looking forward to seeing this in CE. I'd love to help
with the testing as I try to integrate it into my app. Could you
give us an update on how the tests are coming? Perhaps we can get a
branch going with groups in it so we could help write the tests if
your running into problems.

On Jan 6, 5:13 pm, Alexis <ale...@designbyalexis.com> wrote:
> This is great news again, Levi. I hope you had a wonderful holiday and
> I commend your staying away from code and email. I did much the same,
> but I watched this thread because it is something quite important to
> us. However, we don't want to rush a good thing, just want to know how
> things are coming along. :-)
>
> All the very best,
> ~ Alexis
>
> On Jan 5, 11:20 am, "Levi Rosol" <levi.ro...@gmail.com> wrote:
>
> > Alexis-
>
> > Sorry it took a while to get back to you (and the group). Took some time off
> > an tried to stay away from email and code as much as i could. :-)
>
> > I did spend some time getting a small number of tests in place, and am now
> > going to start moving the Group functionality into the CE plugin itself
> > (instead of my app).
>
> > I'll keep the group posted as i progress.
>
> > --
> > Levi Rosol
> > Twitter: @LeviRosol
>
> > On Fri, Jan 2, 2009 at 10:30 AM, Alexis <ale...@designbyalexis.com> wrote:
>
> > > Happy New Year, Everyone!!!
>
> > > How is the testing forGroupscoming? We are holding our breath,
> > > here :-)
>
> > > ~ Alexis
>
> > > On Dec 15 2008, 7:47 am, "Bruno Bornsztein"
> > > <bruno.bornszt...@gmail.com> wrote:
> > > > More tests = better.
> > > > It's very hard for me to add big pieces of functionality to CE and make
> > > sure
> > > > they're bug free without having good test coverage. Last I checked CE's
> > > test
> > > > coverage was around 90%, so that's a good number to shoot for.
>
> > > > On Mon, Dec 15, 2008 at 9:45 AM, Carl Fyffe <carl.fy...@gmail.com>
> > > wrote:
>
> > > > > Where's your test Levi?  *chuckle* Hope that helps.
>
> > > > > CE is using Test::Unit
>
> > > > > On Mon, Dec 15, 2008 at 10:23 AM, Levi Rosol <levi.ro...@gmail.com>
> > > wrote:
> > > > > > good news.groupsnow have all of the functionality a user would
> > > > > >>>>> As of right nowgroupscan be created, a location assigned,
> ...
>
> read more »

Levi Rosol

unread,
Jan 25, 2009, 3:10:31 PM1/25/09
to communi...@googlegroups.com
that's probably the best idea since i am running low on time to put toward this. I'm not sure what we need to do to start a branch in git. also, the code i'm working with is not on the latest version of rails, so a merge into the existing code base will be needed.

if someone could branch the trunk, I can start to merge my changes into it, then check in my changes so others can help out.

--
Levi Rosol
Twitter: @LeviRosol


jdutil

unread,
Jan 28, 2009, 5:53:50 PM1/28/09
to CommunityEngine
Bruno would need to set a new branch up since he is the only one with
access I think. I just created a fork from the edge branch at
http://github.com/jdutil/communityengine/tree/master if you want you
could check that out and push your group changes to that, or start
your own fork and push the changes there. Github has good tutorials
under the guides section if you need help working with github.

On Jan 25, 3:10 pm, Levi Rosol <levi.ro...@gmail.com> wrote:
> that's probably the best idea since i am running low on time to put toward
> this. I'm not sure what we need to do to start a branch in git. also, the
> code i'm working with is not on the latest version of rails, so a merge into
> the existing code base will be needed.
>
> if someone could branch the trunk, I can start to merge my changes into it,
> then check in my changes so others can help out.
>
> --
> Levi Rosol
> Twitter: @LeviRosol
>
> ...
>
> read more »

Bruno Bornsztein

unread,
Jan 28, 2009, 6:45:09 PM1/28/09
to communi...@googlegroups.com
You guys can create a new branch in your own fork, and then I can pull it. Otherwise, I'll create one when I get a chance (just had a baby, very short of sleep/time).
Thanks!
Bruno

jdutil

unread,
Jan 28, 2009, 10:23:50 PM1/28/09
to CommunityEngine
Congratulations.

On Jan 28, 6:45 pm, Bruno Bornsztein <bruno.bornszt...@gmail.com>
wrote:
> You guys can create a new branch in your own fork, and then I can pull it.
> Otherwise, I'll create one when I get a chance (just had a baby, very short
> of sleep/time).
> Thanks!
> Bruno
>
> On Wed, Jan 28, 2009 at 4:53 PM, jdutil <jduti...@gmail.com> wrote:
>
> > Bruno would need to set a new branch up since he is the only one with
> > access I think.  I just created a fork from the edge branch at
> >http://github.com/jdutil/communityengine/tree/masterif you want you
> ...
>
> read more »

Alexis

unread,
Feb 1, 2009, 2:39:52 PM2/1/09
to CommunityEngine
Levi,

I would have loved to take part in this but I have just emerged from
two eye surgeries for glaucoma and it will be weeks before I can
really work much online. I wish you all the best with this, and really
wish I could participate. Good luck!

~ Alexis

On Jan 25, 12:10 pm, Levi Rosol <levi.ro...@gmail.com> wrote:
> that's probably the best idea since i am running low on time to put toward
> this. I'm not sure what we need to do to start a branch in git. also, the
> code i'm working with is not on the latest version of rails, so a merge into
> the existing code base will be needed.
>
> if someone could branch the trunk, I can start to merge my changes into it,
> then check in my changes so others can help out.
>
> --
> Levi Rosol
> Twitter: @LeviRosol
>
> ...
>
> read more »

Bruno Bornsztein

unread,
Feb 4, 2009, 4:19:19 PM2/4/09
to communi...@googlegroups.com
Hey y'all,
The groups branch is on GitHub:

http://github.com/bborn/communityengine/tree/groups

Thanks,
Bruno

jdutil

unread,
Feb 4, 2009, 6:31:57 PM2/4/09
to CommunityEngine
Awesome I'm going to take a look at it now.

On Feb 4, 4:19 pm, Bruno Bornsztein <bruno.bornszt...@gmail.com>
wrote:
> ...
>
> read more »

jdutil

unread,
Feb 4, 2009, 7:20:18 PM2/4/09
to CommunityEngine
Well I would like to but i'm having trouble figuring out how to
checkout the branch. If I do the clone i get the master branch every
time and if I switch to the groups branch I can't update to be the
branches code. Can someone help?
> ...
>
> read more »

Levi Rosol

unread,
Feb 4, 2009, 7:26:32 PM2/4/09
to communi...@googlegroups.com
Great. I'll work to get my code added tonight or tomorrow.
--
Sent from my mobile device

jdutil

unread,
Feb 4, 2009, 7:50:01 PM2/4/09
to CommunityEngine
Oh must be because there is no different code... Thought you had
already merged the code with Bruno.

On Feb 4, 7:26 pm, Levi Rosol <levi.ro...@gmail.com> wrote:
> Great. I'll work to get my code added tonight or tomorrow.
>
> ...
>
> read more »

Levi Rosol

unread,
Jun 14, 2009, 12:23:24 AM6/14/09
to communi...@googlegroups.com
doing some thread reviving, but I'm getting back into CE again and spent today migrating the Groups code that i wrote back in late Feb into the CE master branch. It's not 100% perfect by any means, but the primary functionality is there. What do i need to do to get this into git? I have my local copy setup correctly I believe. All of the group code is in the community_engine plugin, and the folder is setup as a git module.

Here's a screen shot:

CE_Groups.png




--
Levi Rosol
Twitter: @LeviRosol
Cell: 319.939.2035

mike muldoon

unread,
Jun 14, 2009, 2:14:05 PM6/14/09
to communi...@googlegroups.com
Nice! I'd like to review this code, and help if I can, but this tree
is not available:

>> > >> On Feb 4, 4:19 pm, Bruno Bornsztein <bruno.bornszt...@gmail.com>

>> > >> >http://github.com/bborn/communityengine/tree/groups

Does it have a new home?

thx!
Mike

Levi Rosol

unread,
Jun 14, 2009, 2:18:46 PM6/14/09
to communi...@googlegroups.com
Thanks. Right now it's just on my PC and has little to no tests built
in. When bruno gets some time I'm sure we'll get a branch setup.
--
Sent from my mobile device

Carl Fyffe

unread,
Jun 14, 2009, 3:23:23 PM6/14/09
to communi...@googlegroups.com
Commit it to your branch on github and then we can pull it from you to
check it out.

Levi Rosol

unread,
Jun 14, 2009, 10:49:08 PM6/14/09
to communi...@googlegroups.com
Carl- Unfortunately I haven't made the leap from SVN to git yet, so I have no clue what i need to do.

I do have git installed, and do have the CE plugin setup as a module, but am not sure what to do to get the code out there. I've got some time now, so i'll do some research.


--
Levi Rosol
Twitter: @LeviRosol



johanntagle

unread,
Jun 16, 2009, 9:51:26 AM6/16/09
to CommunityEngine
Hi Levi,

Following this should do it: http://github.com/guides/fork-a-project-and-submit-your-modifications

Also looking forward to seeing your code =)

Johann

On Jun 15, 10:49 am, Levi Rosol <levi.ro...@gmail.com> wrote:
> Carl- Unfortunately I haven't made the leap from SVN to git yet, so I have
> no clue what i need to do.
>
> I do have git installed, and do have the CE plugin setup as a module, but am
> not sure what to do to get the code out there. I've got some time now, so
> i'll do some research.
>
> --
> Levi Rosol
> Twitter: @LeviRosol
>
> On Sun, Jun 14, 2009 at 2:23 PM, Carl Fyffe <carl.fy...@gmail.com> wrote:
>
> > Commit it to your branch on github and then we can pull it from you to
> > check it out.
>
> > On 6/14/09, Levi Rosol <levi.ro...@gmail.com> wrote:
>
> > > Thanks. Right now it's just on my PC and has little to no tests built
> > > in. When bruno gets some time I'm sure we'll get a branch setup.
>

Levi Rosol

unread,
Jun 16, 2009, 10:03:21 AM6/16/09
to communi...@googlegroups.com
Johann, thanks for that link. I tried to get it out there last night, but git was kicking my butt, so i moved on to something more productive. sometimes process changes are the hardest things to grasp for some reason  :)

I plan to revisit the git issue tonight, and honestly, i think the link you provided is exactly what I needed.

And please don't get your hopes up about the code being any sort of masterpiece  :) It's my first stab at doing anything in the Ruby world, so IMO, it's a lot of copy/paste/rename. I hope that at a minimum, it serves as a starting place for the Group functionality.


--
Levi Rosol
Twitter: @LeviRosol



Levi Rosol

unread,
Jun 16, 2009, 10:03:56 PM6/16/09
to communi...@googlegroups.com
Looks like i was able to get my stuff out there. My issue was that i never went through the SSH stuff.  newb mistake  :)

feel free to check it out and let me know what you think.

please be nice :)



--
Levi Rosol
Twitter: @LeviRosol



Reply all
Reply to author
Forward
0 new messages