yaaf 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f78d26d774f33785958812a5d3d449b5aa882c297f07e19436410d01bfb5157a
4
- data.tar.gz: cfaa5d69b5041de56aad4b8b32059dff8512fdf0931165f2260320abc6d7ec53
3
+ metadata.gz: 3a1722cf68a3ac8c7aa91f75205ff4885bae7a94fbf8764c94c2b0466959174a
4
+ data.tar.gz: d35126b6b21dbd8e57fa67090ba8802323f4adbd61514cb50b0002adb48e2987
5
5
  SHA512:
6
- metadata.gz: 05a43329b36959802bd0b1f81fc6d5d039a4090cd7fbba5d7fca5cf8b6e2c93779270fbe3ead65246367f22e5d23b917d8776a9e8e8859f40c2ed4d468c9ce35
7
- data.tar.gz: 0cbfcbf3253f87f190364da712a9fda48f4354263a419d6c01ce571897454f27b8b8e0c616f04e7a0534ede4a5525d1d6c0bf590f18b2ec2db06556ad29d3f2f
6
+ metadata.gz: 64ef092463adeacde6d6a4dd42c660ae005255de36ec6df071575d08086029dd6bd62bd212eba4add212eb437c402edb8f083758e3b1a7d4a61e628ec978d94b
7
+ data.tar.gz: 26cda08a6ef4ad7dc741ade6ddce45e77720ecf979a9e788492c471ba486ed09b8a4791e81acaf3ac3ed8da875b5483928145ceec5e69c04060cdcb47f94ff41
data/README.md CHANGED
@@ -113,7 +113,7 @@ class RegistrationsController < ApplicationController
113
113
  registration_form = RegistrationForm.new(user_attributes: user_params)
114
114
 
115
115
  if registration_form.save
116
- redirect_to registration.user
116
+ redirect_to registration_form.user
117
117
  else
118
118
  render :new
119
119
  end
@@ -31,8 +31,14 @@ module YAAF
31
31
  attr_accessor :models
32
32
 
33
33
  def promote_errors(model)
34
- model.errors.each do |attribute, message|
35
- errors.add(attribute, message)
34
+ if rails_version_less_than_6_1?
35
+ model.errors.each do |attribute, message|
36
+ errors.add(attribute, message)
37
+ end
38
+ else
39
+ model.errors.each do |model_error|
40
+ errors.add(model_error.attribute, model_error.message)
41
+ end
36
42
  end
37
43
  end
38
44
 
@@ -60,5 +66,10 @@ module YAAF
60
66
  run_callbacks :rollback
61
67
  raise exception
62
68
  end
69
+
70
+ def rails_version_less_than_6_1?
71
+ ActiveModel::VERSION::MAJOR < 6 ||
72
+ ActiveModel::VERSION::MAJOR == 6 && ActiveModel::VERSION::MINOR.zero?
73
+ end
63
74
  end
64
75
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module YAAF
4
- VERSION = '0.1.1'
4
+ VERSION = '0.2.0'
5
5
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yaaf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Manuel Ramallo
8
8
  - Santiago Bartesaghi
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-04-11 00:00:00.000000000 Z
12
+ date: 2021-01-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activemodel
@@ -149,7 +149,7 @@ dependencies:
149
149
  - - "~>"
150
150
  - !ruby/object:Gem::Version
151
151
  version: 1.4.2
152
- description:
152
+ description:
153
153
  email:
154
154
  - juan.ramallo@rootstrap.com
155
155
  executables: []
@@ -167,7 +167,7 @@ licenses:
167
167
  metadata:
168
168
  homepage_uri: https://github.com/rootstrap/yaaf
169
169
  source_code_uri: https://github.com/rootstrap/yaaf
170
- post_install_message:
170
+ post_install_message:
171
171
  rdoc_options: []
172
172
  require_paths:
173
173
  - lib
@@ -182,8 +182,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
182
182
  - !ruby/object:Gem::Version
183
183
  version: '0'
184
184
  requirements: []
185
- rubygems_version: 3.1.0.pre2
186
- signing_key:
185
+ rubygems_version: 3.2.0.rc.1
186
+ signing_key:
187
187
  specification_version: 4
188
188
  summary: Easing the form object pattern in Rails applications.
189
189
  test_files: []