Having got quite used to Rails.root returning a Pathname object to allow easy concatenation of paths, I noticed that Rails.public_path doesn’t. I checked in 2.3.5 and master and it’s not in either case.
It seems easy enough to do:
railties/lib/initializer.rb (for 2.3.5):
def public_path
@@public_path ||= Pathname(self.root ? File.join(self.root, “public”) : “public”)
end
railties/lib/rails.rb (for 3.0 beta):
def public_path
@@public_path ||= Pathname(self.root ? File.join(self.root, “public”) : “public”)
end
Am I missing something? Is there a reason for the inconsistency that I’m unaware of?
I’m happy to provide a patch if required, but it’s going to be fairly minimal given the change above is Pathname and two parenthesis
Cheers,
Andy