Jonathan Viney
2006-Nov-01 07:23 UTC
[ANN] active_record_base_without_table plugin - Easily use models without tables
Hi all, Here''s another little plugin I wrote to use AR models without tables. It''s dead simple, just extend from ActiveRecord::BaseWithoutTable instead of ActiveRecord::Base: class Contact < ActiveRecord::BaseWithoutTable column :name, :string column :email_address, :string column :message, :text validates_presence_of :name, :email_address, :message end You can now use this model just like you would use a regular model based on a table. Any problems, let me know. -Jonathan. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Jonathan Viney
2006-Nov-01 07:24 UTC
Re: [ANN] active_record_base_without_table plugin - Easily use models without tables
And the install address .... http://svn.viney.net.nz/things/rails/plugins/active_record_base_without_table -Jonathan. On 11/1/06, Jonathan Viney <jonathan.viney-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hi all, > > Here''s another little plugin I wrote to use AR models without tables. It''s > dead simple, just extend from ActiveRecord::BaseWithoutTable instead of > ActiveRecord::Base: > > class Contact < ActiveRecord::BaseWithoutTable > column :name, :string > column :email_address, :string > column :message, :text > > validates_presence_of :name, :email_address, :message > end > > You can now use this model just like you would use a regular model based > on a table. > > Any problems, let me know. > > -Jonathan. >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
captaincrash
2006-Nov-12 02:07 UTC
Re: active_record_base_without_table plugin - Easily use models without tables
Great idea but i just get "uninitialized constant BaseWithoutTable" --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Jonathan Viney
2006-Nov-12 13:10 UTC
Re: active_record_base_without_table plugin - Easily use models without tables
Use ActiveRecord::BaseWithoutTable, not just BaseWithoutTable. A few people are using it, including myself, so it definitely works. -Jonathan. On 11/12/06, captaincrash <frandoestoast-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Great idea but i just get "uninitialized constant BaseWithoutTable" > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---