0.0
No commit activity in last 3 years
No release in over 3 years
Validate an entire [ActiveRecord] table, checking for things like blank rows or total number of rows
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Project Readme

table_warnings¶ ↑

NOTE: only for activerecord right now because it uses count(:conditions => [...])

How to define warning signs¶ ↑

class AutomobileMake < ActiveRecord::Base
  warn_if_blanks :name
  warn_if_blanks :fuel_efficiency
  warn_unless_size :hundreds
end

How to see warnings for the table¶ ↑

?> AutomobileMake.table_warnings
=> [ "Table is not of expected size" ]

Defense¶ ↑

  • This is not the same as validations, because those interfere with the saving of individual records

Self-criticism¶ ↑

  • Maybe this should work work on any class that defines .all

Copyright 2011 Seamus Abshere