Displaying 2 results from an estimated 2 matches for "barrier_meters".
2011 Jun 19
10
validates_numercality_of with allow_nil.
In the model I have:
validates :square_meters_public_land, :barrier_meters, :numericality
=> { :greater_than_or_equal_to => 0 }, :allow_nil => true
but if, in the field, on create, I don''t insert a value I have the
error "field is not a number".
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails:...
2011 May 25
1
rake task: uninitialized constant
...task :pericolanti => :environment do
UnsafeBuilding.delete_all
puts "Creating unsafe_buildings..."
lines = FasterCSV.read(''/home/user/Docs/pericolanti'')
lines.each do |row|
if row.any?
# controllo che row[10] e row[11] non siano stringhe
barrier_meters = row[10] if row[10].is_a?(Float) or
row[10].is_a?(Integer)
square_meters_public_land = row[11] if row[11].is_a?(Float) or
row[11].is_a?(Integer)
practice_number = row[17].to_i
practice_date = parse_date_string(row[3])
practice_new_date = parse_date_string(row[3])...