tonymarschall
tonymarschall

Reputation: 3882

How can i access Ruby/Rails core date class within module?

I overload some classes of a module with an initializer script. In the module there is a class called Date so it is not possible to use Date.today or other date methods. How can i access Ruby/Rails core date class? Rails::Date does not work.

Upvotes: 2

Views: 247

Answers (1)

Rishav Rastogi
Rishav Rastogi

Reputation: 15492

You can just use "::" before the Date class.

Rails just extends the Ruby Core Date class, so you can just use

  ::Date.today

Upvotes: 3

Related Questions