freeform 0.0.3.rc3 → 0.0.3.rc4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/freeform/form.rb CHANGED
@@ -7,6 +7,7 @@ require 'freeform/form/property'
7
7
  require 'freeform/form/validation'
8
8
 
9
9
  module FreeForm
10
+ class FormInvalid < StandardError; end
10
11
  class Form
11
12
  extend Forwardable
12
13
  extend ActiveModel::Naming
@@ -46,7 +47,7 @@ module FreeForm
46
47
  end
47
48
 
48
49
  def save!
49
- raise StandardError, "form invalid." unless valid?
50
+ raise FreeForm::FormInvalid, "form invalid." unless valid?
50
51
  self.class.models.each do |form_model|
51
52
  if send(form_model).is_a?(Array)
52
53
  send(form_model).each { |model| model.save! }
@@ -1,3 +1,3 @@
1
1
  module Freeform
2
- VERSION = "0.0.3.rc3"
2
+ VERSION = "0.0.3.rc4"
3
3
  end
@@ -203,7 +203,7 @@ describe FreeForm::Form do
203
203
  end
204
204
 
205
205
  it "should raise error on 'save!'" do
206
- expect{ form.save!.should be_false }.to raise_error
206
+ expect{ form.save!.should be_false }.to raise_error(FreeForm::FormInvalid)
207
207
  end
208
208
  end
209
209
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: freeform
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3.rc3
4
+ version: 0.0.3.rc4
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors: