Regarding tutorials/docs -- would there really be a problem with doing this,
then:

class ActiveRecord
  Base = self
end

In other words, ::Base would still work, it'd just be redundant, and
probably depricated.

As for the clarity, there's plenty of indirection anyway. I'd rather have a
clear API.

In fact, that is the whole point of Rails, to me -- having everything be
clear, simple, and easy, so I have less to think about. ::Base is
information I don't need, and don't care about. It's not DRY, and it's
pointless.

But I'm also not sure how much it's worth arguing about.

On Thu, Oct 9, 2008 at 5:56 PM, Ryan Bigg <[EMAIL PROTECTED]> wrote:

>
> It's too major of a change to make imo and there's just too many
> tutorials/docs out there that reference Class Model <
> ActiveRecord::Base. To me, it makes sense that a model "inherits from"
> ActiveRecord::Base because that's where a model gets its methods from.
>
> -----
> Ryan Bigg
> Freelancer
> http://frozenplague.net
>
>
>
>
>
>
>
> On 10/10/2008, at 9:01 AM, Manfred Stienstra wrote:
>
> >
> >
> > On Oct 9, 2008, at 7:58 PM, S. Brent Faulkner wrote:
> >>
> >>> One of the things about the Rails code that people tend to frown
> >>> upon
> >>> is the Base class. I was wondering if anyone ever considered
> >>> replacing
> >>
> >> Can you point me in the direction of some discussion of what's wrong
> >> with the "Base class" that people "frown upon"?
> >
> > I don't know of any articles that talk about this, I've mostly
> > discussed it face-to-face.
> >
> > And example of a project that changed their API is Datamapper, they
> > went from:
> >
> >   class Author < DataMapper::Base; end
> >
> > To
> >
> >   class Author; include DataMapper::Resource; end
> >
> >> Just wondering, since I don't recall a problem off-hand?
> >
> > There is no problem in the sense that tests are failing or a feature
> > is broken. It's just weird to have a class with a non-descriptive
> > name.
> >
> > I get the feeling that the Base class was created because David wanted
> > to create a namespace named ActiveRecord to prevent conflicts but also
> > wanted to have something you could inherit from.
> > ActiveRecord::ActiveRecord is weird, so it ended up being
> > ActiveRecord::Base. I personally think ActiveRecord::Model or just
> > ActiveRecord would have been a better name.
> >
> > I see a lot of people using this as an idiom in other Ruby libraries
> > and applications because they learn their first Ruby by developing a
> > Rails applications, even though this idiom might not fit their
> > project.
> >
> > Manfred
> >
> > >
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to