gberz3
2007-May-25 22:00 UTC
Recreating the Wheel: Using Composite Keys, and RESTful Authentication split between models. . .?
Hi All, I''m interested in creating something similar to, but not the same as, Basecamp. I know, I know, why reinvent the wheel? Well, honestly, because it''s not my wheel and it''s rather hard to make a living off of others'' wheels. ;) Anyway, I''m interested in creating a RESTFul setup with a few levels of models. The most notable of which are Company, and User. As it stands (or as I understand it), creating a RestfulAuthentication model involves a single Model and Controller. However, with an application of this nature I''m going to need a Company model that has many Users. In order to both allow new companies to create usernames that are "already used" by other companies, and limit redundancy within a single company, I''m going to need composite keys. So, I''m looking for quality (notice *quality*) URLs or direct information regarding the following: 1) composite keys 2) restful authentication setup split between multiple models 3) any tips, tricks, recommendations, or warnings you have for an endeavor of this nature. 4) any correction of potential misunderstandings I may have Thanks in advance! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
gberz3
2007-May-26 22:30 UTC
Re: Recreating the Wheel: Using Composite Keys, and RESTful Authentication split between models. . .?
Anyone? On May 25, 6:00 pm, gberz3 <gbe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi All, > > I''m interested in creating something similar to, but not the same as, > Basecamp. I know, I know, why reinvent the wheel? Well, honestly, > because it''s not my wheel and it''s rather hard to make a living off of > others'' wheels. ;) > > Anyway, I''m interested in creating a RESTFul setup with a few levels > of models. The most notable of which are Company, and User. As it > stands (or as I understand it), creating a RestfulAuthentication model > involves a single Model and Controller. However, with an application > of this nature I''m going to need a Company model that has many Users. > In order to both allow new companies to create usernames that are > "already used" by other companies, and limit redundancy within a > single company, I''m going to need composite keys. > > So, I''m looking for quality (notice *quality*) URLs or direct > information regarding the following: > > 1) composite keys > 2) restful authentication setup split between multiple models > 3) any tips, tricks, recommendations, or warnings you have for an > endeavor of this nature. > 4) any correction of potential misunderstandings I may have > > Thanks in advance!--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Rick Olson
2007-May-27 02:05 UTC
Re: Recreating the Wheel: Using Composite Keys, and RESTful Authentication split between models. . .?
On 5/25/07, gberz3 <gberz3-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hi All, > > > I''m interested in creating something similar to, but not the same as, > Basecamp. I know, I know, why reinvent the wheel? Well, honestly, > because it''s not my wheel and it''s rather hard to make a living off of > others'' wheels. ;) > > Anyway, I''m interested in creating a RESTFul setup with a few levels > of models. The most notable of which are Company, and User. As it > stands (or as I understand it), creating a RestfulAuthentication model > involves a single Model and Controller. However, with an application > of this nature I''m going to need a Company model that has many Users. > In order to both allow new companies to create usernames that are > "already used" by other companies, and limit redundancy within a > single company, I''m going to need composite keys. > > So, I''m looking for quality (notice *quality*) URLs or direct > information regarding the following: > > > 1) composite keys > 2) restful authentication setup split between multiple models > 3) any tips, tricks, recommendations, or warnings you have for an > endeavor of this nature. > 4) any correction of potential misunderstandings I may have1) ??? 2) account_location plugin: http://svn.rubyonrails.org/rails/plugins/account_location/README -- Rick Olson http://lighthouseapp.com http://weblog.techno-weenie.net http://mephistoblog.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Bill Kocik
2007-May-27 12:21 UTC
Re: Recreating the Wheel: Using Composite Keys, and RESTful Authentication split between models. . .?
On May 25, 6:00 pm, gberz3 <gbe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 1) composite keysI haven''t used this, but it''s from Dr. Nic, so I suspect it''s good: http://rubyforge.org/projects/compositekeys --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
gberz3
2007-May-29 16:43 UTC
Re: Recreating the Wheel: Using Composite Keys, and RESTful Authentication split between models. . .?
Rick, I was speaking in #1 about the need for composite keys in order to accommodate for Companies with many Users. Does that make sense or am I missing something? - Michael On May 26, 10:05 pm, "Rick Olson" <technowee...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 5/25/07,gberz3<gbe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > Hi All, > > > I''m interested in creating something similar to, but not the same as, > > Basecamp. I know, I know, why reinvent the wheel? Well, honestly, > > because it''s not my wheel and it''s rather hard to make a living off of > > others'' wheels. ;) > > > Anyway, I''m interested in creating a RESTFul setup with a few levels > > of models. The most notable of which are Company, and User. As it > > stands (or as I understand it), creating a RestfulAuthentication model > > involves a single Model and Controller. However, with an application > > of this nature I''m going to need a Company model that has many Users. > > In order to both allow new companies to create usernames that are > > "already used" by other companies, and limit redundancy within a > > single company, I''m going to need composite keys. > > > So, I''m looking for quality (notice *quality*) URLs or direct > > information regarding the following: > > > 1) composite keys > > 2) restful authentication setup split between multiple models > > 3) any tips, tricks, recommendations, or warnings you have for an > > endeavor of this nature. > > 4) any correction of potential misunderstandings I may have > > 1) ??? > 2) account_location plugin:http://svn.rubyonrails.org/rails/plugins/account_location/README > > -- > Rick Olsonhttp://lighthouseapp.comhttp://weblog.techno-weenie.nethttp://mephistoblog.com--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Douglas Shearer
2007-May-29 22:33 UTC
Re: Recreating the Wheel: Using Composite Keys, and RESTful
gberz3 wrote:> Rick, > > I was speaking in #1 about the need for composite keys in order to > accommodate for Companies with many Users. Does that make sense or am > I missing something? > > > - MichaelWhy use a composite key? It is not going to make your url look any nicers. If you use a standard Rails model with a primary key of ID, you can create URLS of the form.... mydomain.com/user/123_bob Where 123 is the id, and Bob is the users (nick) name. You can get this easily in rails using the to_param method in your model... to_param "#{id}_#{nick}" end By doing this you get a nice readable url, using a standard Rails model. From this you can then do nested resources like... mydomian.com/company/alicecorp/user/123_bob Hope this helps, or at least gives you ideas you can work from. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---