List Info

Thread: class_name method in AR::Base




class_name method in AR::Base
user name
2006-10-02 06:18:07
I've been playing around with nested models and ran across
the method
named class_name in Base. While looking at how to modify
this to
support nested models, I figured out that it doesn't appear
to be used
at all in the code base.

Does this method still have a purpose? In what situation
would you want
to determine a class_name from a table name?

I looked through trac but it existed in the oldest version
in trac so i
couldn't track down it use.

Bob Silva


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Ruby on Rails: Core" group.
To post to this group, send email to rubyonrails-coregooglegroups.com
To unsubscribe from this group, send email to
rubyonrails-core-unsubscribegooglegroups.com
For more options, visit this group at http:
//groups.google.com/group/rubyonrails-core
-~----------~----~----~----~------~----~------~--~---

class_name method in AR::Base
user name
2006-10-02 07:38:24
On 10/2/06, MacProBob <bobtheslobgmail.com> wrote:
>
> I've been playing around with nested models and ran
across the method
> named class_name in Base. While looking at how to
modify this to
> support nested models, I figured out that it doesn't
appear to be used
> at all in the code base.
>
> Does this method still have a purpose? In what
situation would you want
> to determine a class_name from a table name?
>
> I looked through trac but it existed in the oldest
version in trac so i
> couldn't track down it use.

When you remove it, all the tests (except the obvious one)
still pass,
 so I'm stumped.  It's :nodoc:'d so it's never been an
advertised
feature.   Unless someone else chimes in,  I can't see why
we wouldn't
just remove it...

-- 
Cheers

Koz

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Ruby on Rails: Core" group.
To post to this group, send email to rubyonrails-coregooglegroups.com
To unsubscribe from this group, send email to
rubyonrails-core-unsubscribegooglegroups.com
For more options, visit this group at http:
//groups.google.com/group/rubyonrails-core
-~----------~----~----~----~------~----~------~--~---

class_name method in AR::Base
user name
2006-10-04 08:46:20

Michael Koziarski wrote:
> On 10/2/06, MacProBob <bobtheslobgmail.com> wrote:
> >
> > I've been playing around with nested models and
ran across the method
> > named class_name in Base. While looking at how to
modify this to
> > support nested models, I figured out that it
doesn't appear to be used
> > at all in the code base.
> >
> > Does this method still have a purpose? In what
situation would you want
> > to determine a class_name from a table name?
> >
> > I looked through trac but it existed in the oldest
version in trac so i
> > couldn't track down it use.
>
> When you remove it, all the tests (except the obvious
one) still pass,
>  so I'm stumped.  It's :nodoc:'d so it's never been an
advertised
> feature.   Unless someone else chimes in,  I can't see
why we wouldn't
> just remove it...

The Magic Models uses it (http://magicmodels.r
ubyforge.org). It ensures
that all the conventions of table prefixes, pluralisation
etc are
supported when dynamically creating ActiveRecords based on
existing
tables.

If you do remove it, then I will add it back into the MM's
explicitly.

Nic


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Ruby on Rails: Core" group.
To post to this group, send email to rubyonrails-coregooglegroups.com
To unsubscribe from this group, send email to
rubyonrails-core-unsubscribegooglegroups.com
For more options, visit this group at http:
//groups.google.com/group/rubyonrails-core
-~----------~----~----~----~------~----~------~--~---

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )