Skip to content

Commit

Permalink
show account error details on message validation
Browse files Browse the repository at this point in the history
  • Loading branch information
schorsch committed Jan 30, 2014
1 parent a5dcf0c commit b09b081
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/sepa_king/message.rb
Expand Up @@ -13,7 +13,7 @@ class Message

validates_presence_of :transactions
validate do |record|
record.errors.add(:account, 'is invalid') unless record.account.valid?
record.errors.add(:account, record.account.errors.full_messages) unless record.account.valid?
end

class_attribute :account_class, :transaction_class, :xml_main_tag, :known_schemas
Expand Down
2 changes: 1 addition & 1 deletion spec/message_spec.rb
Expand Up @@ -33,7 +33,7 @@ class DummyMessage < SEPA::Message

it 'should fail with invalid account' do
subject.should_not be_valid
subject.should have(1).error_on(:account)
subject.should have(2).error_on(:account)
end

it 'should fail without transactions' do
Expand Down

0 comments on commit b09b081

Please sign in to comment.