mirror of
https://github.com/ditkrg/validates_timeliness.git
synced 2026-01-23 06:16:44 +00:00
Fix shadowing
This commit is contained in:
parent
ad43eb31d6
commit
ff131415f7
@ -16,9 +16,9 @@ module ValidatesTimeliness
|
|||||||
|
|
||||||
if ActiveModel.version >= Gem::Version.new('4.2')
|
if ActiveModel.version >= Gem::Version.new('4.2')
|
||||||
def timeliness_column_for_attribute(attr_name)
|
def timeliness_column_for_attribute(attr_name)
|
||||||
columns_hash.fetch(attr_name.to_s) do |attr_name|
|
columns_hash.fetch(attr_name.to_s) do |key|
|
||||||
validation_type = _validators[attr_name.to_sym].find {|v| v.kind == :timeliness }.type.to_s
|
validation_type = _validators[key.to_sym].find {|v| v.kind == :timeliness }.type.to_s
|
||||||
::ActiveRecord::ConnectionAdapters::Column.new(attr_name, nil, lookup_cast_type(validation_type), validation_type)
|
::ActiveRecord::ConnectionAdapters::Column.new(key, nil, lookup_cast_type(validation_type), validation_type)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -31,9 +31,9 @@ module ValidatesTimeliness
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
def timeliness_column_for_attribute(attr_name)
|
def timeliness_column_for_attribute(attr_name)
|
||||||
columns_hash.fetch(attr_name.to_s) do |attr_name|
|
columns_hash.fetch(attr_name.to_s) do |key|
|
||||||
validation_type = _validators[attr_name.to_sym].find {|v| v.kind == :timeliness }.type.to_s
|
validation_type = _validators[key.to_sym].find {|v| v.kind == :timeliness }.type.to_s
|
||||||
::ActiveRecord::ConnectionAdapters::Column.new(attr_name, nil, validation_type)
|
::ActiveRecord::ConnectionAdapters::Column.new(key, nil, validation_type)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user