On 7/6/08, Bryan Liles <[EMAIL PROTECTED]> wrote:
>
>
>  On Jul 6, 2008, at 3:51 AM, tonypm wrote:
>
>  > I have been bitten by errors, and template name clashes and the like,
>  > but coming up with an extended name in the app is usually fairly
>  > trivial.
>  >
>
>
> This is where I take issue.  Coding around the framework feels weird.
>
>
>  > After all, you are going to inflict __ throughout every application in
>  > every situation.  That would be a shame since I would have thought
>  > that in many cases problems with name conflicts occur rarely.
>
>
> You won't see the __ as much as you think.  The __ is for framework
>  defined instance variables (in the templates).  I also put up an
>  example about #errors in ActiveRecord::Base.  In this case, I wouldn't
>  mind dipping into another namespace to get my errors, but I'm not
>  convinced my solution is optimal.

I think it'd be pretty annoying to start using #validation_errors.
There are a bunch of other public methods that could potentially run
into issues.  It's probably easy enough to just create a custom
accessor:

def foo_errors
  self[:errors]
end

def foo_errors=(value)
  self[:errors] = value
end

I agree that the internal variables should have ugly underscored
names.  The problem is that it's not exactly trivial to replace
everything in a way that doesn't trash someone else's existing app or
plugin.  I'd suggest starting a git branch started and having folks
run it against their apps to see what breaks.

-- 
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: 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