Use attr_accessor for Rails.{application,cache,logger} #8395

Merged
merged 1 commit into from Dec 8, 2012

Projects

None yet

5 participants

@bmaland
Contributor
bmaland commented Dec 1, 2012

No description provided.

@jeremy
Member
jeremy commented Dec 1, 2012

Think these reader methods are on purpose, to avoid Ruby warnings...

@semanticart

I'm curious, what warnings would this avoid? attr_accessor does avoid the instance variable not initialized warning.

@carlosantoniodasilva

I think rdoc would generate them as attributes instead of public methods, it's the only thing I remember right now (and I'm not 100% sure :D).

@pixeltrix
Member

I think it was because they were originally class variable and not instance variables so you wouldn't have been able to use attr_accessor. They were changed to instance variables fairly recently - see #5759.

@carlosantoniodasilva carlosantoniodasilva merged commit bef3308 into rails:master Dec 8, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment