switched to using Rails::VERSION constant instead of AR which doesn't

seem to be available on rails boot
This commit is contained in:
Adam Meehan
2008-05-05 09:41:16 +10:00
parent d3e278069e
commit 4ee24faad4
2 changed files with 7 additions and 4 deletions

View File

@@ -15,7 +15,7 @@ module ValidatesTimeliness
module AttributeMethods
def self.included(base)
if ActiveRecord::VERSION::STRING < '2.1'
if Rails::VERSION::STRING < '2.1'
base.extend ClassMethods::Old
else
base.extend ClassMethods::New
@@ -23,7 +23,7 @@ module ValidatesTimeliness
end
module ClassMethods
# ActiveRecord >= 2.1
# Rails >= 2.1
module New
def define_read_method_for_time_zone_conversion(attr_name)
method_body = <<-EOV
@@ -57,7 +57,7 @@ module ValidatesTimeliness
end
end # New
# ActiveRecord < 2.1
# Rails < 2.1
module Old
def define_attribute_methods
return if generated_methods?