El Dorado

A full-stack community web application written in Ruby/Rails
subscriptions « El Dorado « almost effortless
 
Thu, 31 Jan 2008, 10:08am #1
cntrytwist
New member
Registered: Jan, 2008
Last visit: Thu, 19 Jun 2008
Posts: 3

Does this include subscriptions to topics and forums?
If so, how do I control the subscriptions.

Offline
Thu, 31 Jan 2008, 5:32pm #2
Trevor
Administrator
Wait-ill-fix-it
Registered: Sep, 2005
Last visit: 29 minutes ago
Posts: 226

I've got subscriptions stubs in, but they're not functional yet (no email-driven features are). I'll add that before going to 1.0, though - it's on the "very short" list.

Offline
Sat, 12 Apr 2008, 4:04pm #3
cmaujean
Member
6
Registered: Apr, 2008
Last visit: Fri, 09 May 2008
Posts: 11

When do you think this will be available? I'm needing this feature yesterday and would be ok with adding it myself, but don't want to duplicate any work you might have done.

Offline
Sun, 13 Apr 2008, 10:59pm #4
Trevor
Administrator
Wait-ill-fix-it
Registered: Sep, 2005
Last visit: 29 minutes ago
Posts: 226

cmaujean, I haven't started any work on that, and I'd love some help. If you want to give it a try, one thing I was considering was making subscriptions a polymorphic association so that any restful object could be subscribed to. We wouldn't need an interface for that right away, but it might be nice to be able to subscribe to a thread, or a forum, or even a category. Then, maybe later on we could allow people to subscribe to users, events, etc. What do you think?

Offline
Sun, 20 Apr 2008, 7:22pm #5
cmaujean
Member
6
Registered: Apr, 2008
Last visit: Fri, 09 May 2008
Posts: 11

Hmmm, I was imagining using ActiveRecord::Observer to do the subscriptions. I don't have any experience using the polymorphic associations, so I don't as of yet have an opinion as to which approach would be better. Based on ease of coding and time to completion (I come from the perl world after all, laziness being a core virtue), I'd prefer to use the Observer approach as I think I could implement it with less effort.

That said, you know the code base, so let me know what you think is right, and I'll see about allocating time to do it.

Offline
Sun, 20 Apr 2008, 7:55pm #6
Trevor
Administrator
Wait-ill-fix-it
Registered: Sep, 2005
Last visit: 29 minutes ago
Posts: 226

I've never used observers, but I think that makes sense. I also haven't done anything with mailing yet, so it'll all be new territory. Doing it with polymorphic associations isn't really necessary to start with, so that sounds good to me. Let me know if/when you're working on it and we can be in touch.

[edit] Take a look at the altered beast app on github, which has some mailing observers that would probably make a good code example: http://github.com/technoweenie/altered_beast/tr...

Last edited Sun, 20 Apr 2008, 8:03pm by Trevor

Offline
Sun, 20 Apr 2008, 8:16pm #7
cmaujean
Member
6
Registered: Apr, 2008
Last visit: Fri, 09 May 2008
Posts: 11

Cool, like I said, this is something I've needed for my installs of eldorado, so I believe I'll be on this during this coming week.

Offline
Sun, 20 Apr 2008, 8:41pm #8
Trevor
Administrator
Wait-ill-fix-it
Registered: Sep, 2005
Last visit: 29 minutes ago
Posts: 226

That's great. Thanks for the help! Also, please let me know how you're using El Dorado - I'd be very curious, because the only installations I know of are the ones I've set up myself :)

Offline
Sun, 20 Apr 2008, 10:22pm #9
cmaujean
Member
6
Registered: Apr, 2008
Last visit: Fri, 09 May 2008
Posts: 11

My company is distributed, programmer in Oregon (me) programmers, project management in California, Designer in Mexico, Sales in British Virgin Islands, customers all over. We had a need to communicate and share files with our customers, for things like design approval, feature requests for web stores, etc. El Dorado has fit the bill so far rather nicely. We have yet to utilize the Events feature, but I'm thinking that'll come in handy with project management.

I currently have 2 instances set up, one for each of our 2 newest customers. I've set them up to be private (thanks for that feature) and only the need to know people have access (designer, programmers, specific customer representatives, project management). We plan on running an instance for each of our new customers as they come in.

This works so much better than dealing with remembering who to cc on what emails, sending out 20 copies of a site design png, and much more.

I can't point you at the installations, as they're company confidential ;)

My company has requested the subscriptions feature and will be paying me to code it up. And, any other features we identify that we need (and you accept as dovetailing with your vision for El Dorado, of course)

Offline
Sun, 20 Apr 2008, 11:04pm #10
cmaujean
Member
6
Registered: Apr, 2008
Last visit: Fri, 09 May 2008
Posts: 11

Also, I've realized that we'll need both polymorphic associations *and* Observer. So I read up on PA and it seems quite easy.

Here's a brain dump of my current thoughts on how to do this:

Subscription:
# id
# user_id
# subscribable_id
# subscribable_type

belongs_to :subscribable, :polymorphic => true

Subscribable models (User, Topic, etc):
has_many :subscriptions, :as => :subscribable, :dependent => true

SubscriptionController:
provides CRUD interface (as per your existing test stubs)

SubscriptionMailer
provides the email bits

TopicObserver
EventObserver
UserObserver
CategoryObserver
observe the models, when appropriate, grab all subscriptions that are relevant, call the mailer

What do you think?

Offline
Mon, 21 Apr 2008, 9:07am #11
Trevor
Administrator
Wait-ill-fix-it
Registered: Sep, 2005
Last visit: 29 minutes ago
Posts: 226

That's an awesome use for El Dorado - thanks for sharing! I thought the privacy feature might help small companies use the app for internal communications (like an intranet, I guess) and it sounds like that's working out for you guys, which is really cool.

You're brain dump sounds 100% in-line with what I was thinking. I'm not sure how the polymorphic naming has to work (could you use subscription_id and subscription_type instead of subscribable_id and subscribable_type?), but I'm not too worried about that, and it seems like that is the convention.

Don't worry about any stubs that are in the app already. I only put those in so that I could import the subscriptions table from my old PunBB installation (the PHP forum I replaced with El Dorado's forum). I probably shouldn't have made the controllers and tests. Once we have the subscriptions working, the rake import:db task will have to get updated as well, but that's easy.

However, with your migration to change the subscriptions to polymorphic, can you save the existing ones? That would just mean changing the name of the second column (topic_id) to subscribable_id and adding a subscribable_type of "topic" to them. If you'd rather not worry about that, it's fine - I can always fix up the migration myself later on.

It's great to have some help with this, and I'm so happy to hear that you're happily using El Dorado yourself. Thanks again!

Offline
Mon, 21 Apr 2008, 5:31pm #12
cmaujean
Member
6
Registered: Apr, 2008
Last visit: Fri, 09 May 2008
Posts: 11

I found a plugin, already built, "acts_as_subscribeable" so I was thinking, why reinvent the wheel, I'll just integrate the plugin.

Offline
Mon, 21 Apr 2008, 6:07pm #13
Trevor
Administrator
Wait-ill-fix-it
Registered: Sep, 2005
Last visit: 29 minutes ago
Posts: 226

Sounds good to me, as long as it's a decent plugin. Check it out and see what you think.

Is it this one? http://github.com/peimei/actsassubscribeable/tr...

Offline
Tue, 22 Apr 2008, 9:11pm #14
cmaujean
Member
6
Registered: Apr, 2008
Last visit: Fri, 09 May 2008
Posts: 11

yeah, it's that one. I've got it partly integrated, it seems good, and mostly seems to be along the same lines as my design.

Offline
Tue, 22 Apr 2008, 10:31pm #15
Trevor
Administrator
Wait-ill-fix-it
Registered: Sep, 2005
Last visit: 29 minutes ago
Posts: 226

Nice, please let me know when you've got something to share. Are you using git or Subversion? I got rid of the Google Code Subversion repo a few days ago - were you using that?

Offline
Wed, 23 Apr 2008, 2:03am #16
cmaujean
Member
6
Registered: Apr, 2008
Last visit: Fri, 09 May 2008
Posts: 11

I love git. I sucked the project down from github.

I track svn repos by importing them into a git repo (git-svn is a pain in the ass), so I would have been using git, even if you were still in svn ;)

Offline
Wed, 30 Apr 2008, 2:16am #17
cmaujean
Member
6
Registered: Apr, 2008
Last visit: Fri, 09 May 2008
Posts: 11

Just a quick note to let you know I'm still working on this.

Offline
Wed, 30 Apr 2008, 9:06am #18
Trevor
Administrator
Wait-ill-fix-it
Registered: Sep, 2005
Last visit: 29 minutes ago
Posts: 226

Cool - thanks for the update.

Offline
Mon, 04 Aug 2008, 8:12pm #19
SLine
New member
Registered: Aug, 2008
Last visit: Sun, 10 Aug 2008
Posts: 2

Hi Trevor,

I'm starting development on a web app for a client today and I'm very interested in using El Dorado for the forums and possibly other features. From what I've read and seen so far it seems very nice. I will download and play with it soon.

The subscription feature mentioned in this thread would be very nice. Has there been any progress on this either from you or cmaujean since the last post here?

Thanks,
Steve
Golden, CO

Offline
Mon, 04 Aug 2008, 9:46pm #20
Trevor
Administrator
Wait-ill-fix-it
Registered: Sep, 2005
Last visit: 29 minutes ago
Posts: 226

Thanks for your interest. No, there hasn't been any progress on subscriptions. I'm trying to finish up the blog right now, and people often say they're going to pitch in with a feature and then disappear, so... :)

Offline