pauladaniel / calendardateselect

Automatically exported from code.google.com/p/calendardateselect
Other
0 stars 0 forks source link

Broken includes on Rails 2.3 #147

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Update to Edge Rails 2.3
2. call calendar_date_select_includes
3.

What is the expected output? What do you see instead?

No error expected.  Receive NoMethodError instead.  "undefined method 
`calendar_date_select_includes'"

What version of the product are you using? On what operating system?

1.13

Please provide any additional information below.

Original issue reported on code.google.com by mdirwi...@att.net on 3 Dec 2008 at 3:01

GoogleCodeExporter commented 8 years ago
The problem is that Rails.root changed in 2.3.  Line 5 of 
calendar_date_select.rb should be changed to:

if Object.const_defined?(:Rails) && File.directory?(Rails.root.join("public"))

This of course will fail in 2.2, so we probably want a more robust tweak

Original comment by nmeerssc...@mac.com on 2 Feb 2009 at 8:27

GoogleCodeExporter commented 8 years ago
Actually, here's a slightly better (backwards compatible) version:

if Object.const_defined?(:Rails) && File.directory?(Rails.root.is_a?(String) ? 
(Rails.root + "/public") : 
Rails.root.join("public"))

Original comment by nmeerssc...@mac.com on 2 Feb 2009 at 8:33

GoogleCodeExporter commented 8 years ago
What about Rails.root.to_s + "/public" ?

Original comment by timchar...@gmail.com on 2 Feb 2009 at 8:35

GoogleCodeExporter commented 8 years ago

Original comment by timchar...@gmail.com on 2 Feb 2009 at 8:35

GoogleCodeExporter commented 8 years ago
I just tried this:

if Object.const_defined?(:Rails) && File.directory?(Rails.root.to_s + "/public")

it works in 2.3.

Original comment by edwin.m...@gmail.com on 19 Feb 2009 at 8:43

GoogleCodeExporter commented 8 years ago

Original comment by timchar...@gmail.com on 20 Feb 2009 at 5:30