Skip to content

Commit

Permalink
added gemspec, fixed validation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanmartin committed Apr 19, 2011
1 parent 51533d5 commit 0b8211f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions kontoapi-rails.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Gem::Specification.new do |s|
"Rakefile",
"VERSION",
"init.rb",
"kontoapi-rails.gemspec",
"lib/kontoapi-rails.rb",
"lib/kontoapi-rails/config.rb",
"lib/kontoapi-rails/orm/active_record_extension.rb",
Expand Down
1 change: 1 addition & 0 deletions lib/kontoapi-rails/orm/mongoid_extension.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# not implemented yet
4 changes: 2 additions & 2 deletions lib/kontoapi-rails/validators/bank_account_validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ def validate(record)
record_options = options.reverse_merge(DEFAULTS)
account_number = record.send(:"#{record_options[:account_number_field]}")
bank_code = record.send(:"#{record_options[:bank_code_field]}")
record.errors[:"#{record_options[:account_number_field]}"] << :invalid unless KontoAPI::valid?(account_number, bank_code)
record.errors.add(:"#{record_options[:account_number_field]}", :invalid) unless KontoAPI::valid?(account_number, bank_code)
rescue Timeout::Error => ex
case record_options[:on_timeout]
when :fail
record.errors[:"#{record_options[:account_number_field]}"] << :timeout
record.errors.add(:"#{record_options[:account_number_field]}", :timeout)
when :ignore
# nop
when :retry
Expand Down

0 comments on commit 0b8211f

Please sign in to comment.