From 732f9c68ccc425fc00c8e7fa764452f086a93193 Mon Sep 17 00:00:00 2001 From: Hao Liu Date: Fri, 21 Nov 2014 11:09:42 +1300 Subject: [PATCH 01/32] Add save! to raise exception if things go wrong --- lib/active_form/base.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/active_form/base.rb b/lib/active_form/base.rb index 21f77bb..9ae7eda 100644 --- a/lib/active_form/base.rb +++ b/lib/active_form/base.rb @@ -42,6 +42,10 @@ def save end end + def save! + save or raise ActiveRecord::RecordInvalid.new(self) + end + def valid? super model.valid? @@ -155,4 +159,4 @@ def collect_errors_from(validatable_object) end end -end \ No newline at end of file +end From 2739020cdc3e952cd511323d69075fd39dbb67af Mon Sep 17 00:00:00 2001 From: Will Bryant Date: Tue, 7 Jul 2015 11:41:26 +1200 Subject: [PATCH 02/32] revert whitespace change for easier merging --- lib/active_form/base.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/active_form/base.rb b/lib/active_form/base.rb index 9ae7eda..9f4431c 100644 --- a/lib/active_form/base.rb +++ b/lib/active_form/base.rb @@ -159,4 +159,4 @@ def collect_errors_from(validatable_object) end end -end +end \ No newline at end of file From f17dd6bf80c3dede32a093bb7e658bfb4201f830 Mon Sep 17 00:00:00 2001 From: Nicolas Rodriguez Date: Tue, 5 Jul 2016 03:01:15 +0200 Subject: [PATCH 03/32] Remove Gemfile.lock --- Gemfile.lock | 96 ---------------------------------------------------- 1 file changed, 96 deletions(-) delete mode 100644 Gemfile.lock diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index a4aa4c3..0000000 --- a/Gemfile.lock +++ /dev/null @@ -1,96 +0,0 @@ -PATH - remote: . - specs: - actionform (0.0.1) - rails (~> 4.1) - -GEM - remote: https://rubygems.org/ - specs: - actionmailer (4.1.8) - actionpack (= 4.1.8) - actionview (= 4.1.8) - mail (~> 2.5, >= 2.5.4) - actionpack (4.1.8) - actionview (= 4.1.8) - activesupport (= 4.1.8) - rack (~> 1.5.2) - rack-test (~> 0.6.2) - actionview (4.1.8) - activesupport (= 4.1.8) - builder (~> 3.1) - erubis (~> 2.7.0) - activemodel (4.1.8) - activesupport (= 4.1.8) - builder (~> 3.1) - activerecord (4.1.8) - activemodel (= 4.1.8) - activesupport (= 4.1.8) - arel (~> 5.0.0) - activesupport (4.1.8) - i18n (~> 0.6, >= 0.6.9) - json (~> 1.7, >= 1.7.7) - minitest (~> 5.1) - thread_safe (~> 0.1) - tzinfo (~> 1.1) - arel (5.0.1.20140414130214) - builder (3.2.2) - erubis (2.7.0) - hike (1.2.3) - i18n (0.6.11) - jquery-rails (3.1.1) - railties (>= 3.0, < 5.0) - thor (>= 0.14, < 2.0) - json (1.8.1) - mail (2.6.3) - mime-types (>= 1.16, < 3) - mime-types (2.4.3) - minitest (5.5.0) - multi_json (1.10.1) - rack (1.5.2) - rack-test (0.6.2) - rack (>= 1.0) - rails (4.1.8) - actionmailer (= 4.1.8) - actionpack (= 4.1.8) - actionview (= 4.1.8) - activemodel (= 4.1.8) - activerecord (= 4.1.8) - activesupport (= 4.1.8) - bundler (>= 1.3.0, < 2.0) - railties (= 4.1.8) - sprockets-rails (~> 2.0) - railties (4.1.8) - actionpack (= 4.1.8) - activesupport (= 4.1.8) - rake (>= 0.8.7) - thor (>= 0.18.1, < 2.0) - rake (10.3.2) - simple_form (3.0.2) - actionpack (~> 4.0) - activemodel (~> 4.0) - sprockets (2.12.3) - hike (~> 1.2) - multi_json (~> 1.0) - rack (~> 1.0) - tilt (~> 1.1, != 1.3.0) - sprockets-rails (2.2.4) - actionpack (>= 3.0) - activesupport (>= 3.0) - sprockets (>= 2.8, < 4.0) - sqlite3 (1.3.9) - thor (0.19.1) - thread_safe (0.3.4) - tilt (1.4.1) - tzinfo (1.2.2) - thread_safe (~> 0.1) - -PLATFORMS - ruby - -DEPENDENCIES - actionform! - jquery-rails - rake (~> 10.3.2) - simple_form - sqlite3 From 209dfb383ccf03a558f01119e9a35daf7608e350 Mon Sep 17 00:00:00 2001 From: Nicolas Rodriguez Date: Tue, 5 Jul 2016 03:01:30 +0200 Subject: [PATCH 04/32] Fix deprecation warnings --- test/dummy/config/environments/test.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/dummy/config/environments/test.rb b/test/dummy/config/environments/test.rb index 053f5b6..3cfff16 100644 --- a/test/dummy/config/environments/test.rb +++ b/test/dummy/config/environments/test.rb @@ -13,7 +13,7 @@ config.eager_load = false # Configure static asset server for tests with Cache-Control for performance. - config.serve_static_assets = true + config.serve_static_files = true config.static_cache_control = 'public, max-age=3600' # Show full error reports and disable caching. @@ -36,4 +36,7 @@ # Raises error for missing translations # config.action_view.raise_on_missing_translations = true + + # Test order + config.active_support.test_order = :random end From ccdfa229d27ab8d8b1255f9f02c2b08fddee608e Mon Sep 17 00:00:00 2001 From: Nicolas Rodriguez Date: Tue, 5 Jul 2016 03:01:48 +0200 Subject: [PATCH 05/32] Fix method signature for SimpleForm --- test/dummy/config/initializers/simple_form.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/dummy/config/initializers/simple_form.rb b/test/dummy/config/initializers/simple_form.rb index 4937a4d..82a938e 100644 --- a/test/dummy/config/initializers/simple_form.rb +++ b/test/dummy/config/initializers/simple_form.rb @@ -78,7 +78,7 @@ # config.collection_value_methods = [ :id, :to_s ] # How the label text should be generated altogether with the required text. - config.label_text = lambda { |label, required| "#{label} #{required}" } + config.label_text = lambda { |label, required, explicit_label| "#{label} #{required}" } # You can define the class to use on all labels. Default is nil. # config.label_class = nil @@ -121,4 +121,4 @@ # Default class for buttons config.button_class = 'btn' -end \ No newline at end of file +end From a102adc65941fced0008a07eb2dd3c5763cb7576 Mon Sep 17 00:00:00 2001 From: Nicolas Rodriguez Date: Tue, 5 Jul 2016 03:02:24 +0200 Subject: [PATCH 06/32] Fix attributes order in SimpleForm forms --- test/forms/nested_model_rendering_test.rb | 149 +++++++++++----------- 1 file changed, 76 insertions(+), 73 deletions(-) diff --git a/test/forms/nested_model_rendering_test.rb b/test/forms/nested_model_rendering_test.rb index f5c01dc..c85789c 100644 --- a/test/forms/nested_model_rendering_test.rb +++ b/test/forms/nested_model_rendering_test.rb @@ -32,16 +32,19 @@ def form_for(*) assert_match(/method="post"/, output_buffer) assert_match(/