README.rdoc in tracking_number-0.5.0 vs README.rdoc in tracking_number-0.6.0

- old
+ new

@@ -14,11 +14,25 @@ TrackingNumber.search("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, 1Z879E930346834440 nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute 9611020987654312345672 dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.") #=> [TrackingNumber, TrackingNumber] +== ActiveModel validation + +For Rails 3 (or any ActiveModel client), validate your fields as a tracking number: + + class Shipment < ActiveRecord::Base + validates :tracking, :tracking_number => true + end + +Sometimes it's helpful to have a "magic" tracking number that isn't valid for any of the real carriers, and maybe will have other side effects (e.g., special treatment of a shipping email.) + + class Shipment < ActiveRecord::Base + validates :tracking, :tracking_number => { :except => 'magic-hand-delivery' } + end + == Contributing to tracking_number - + * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it * Fork the project * Start a feature/bugfix branch * Commit and push until you are happy with your contribution