active_form_objects 2.0.0 → 2.0.1

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: 8b5ee38f5092d2cb6590e7fb237b5c578e62cef571cb677257304a6c7f72f271
4
- data.tar.gz: f6391721dc190de74fdf20e3a7d08a018dbdb6cc96dd460fe5eaf20c0df0836a
3
+ metadata.gz: 3c1b13583aed6b595d8dded34bbab6c0eb0453880b1689b36f6c83b2c42864fd
4
+ data.tar.gz: 173f5611e40785b68f19f3b0969b34a40580110b7dfac3d8a83a7c959c4b2b2d
5
5
  SHA512:
6
- metadata.gz: de2a9c8359c493a530c48a37a5db6e226ae6e7c75fdb4833f029c88fd0be2ae09646bb66acc08477a897bc2ee51057685fdb117f8e21c61f1baf9b3d15b70336
7
- data.tar.gz: de1dcfd0387febc4f01aa471248d150790039e10349e0f3d57ceec3c4b8e6e96ad80f336b9d56e2fc7e97dca53c70cd4941821676ed21d4058f4954fc6b5ed4d
6
+ metadata.gz: c222d8eea18ff97532ef450482f1ed7411e33fec22910a2fc4b1223d2081b296eec2dfb085fbdf90181bc60e54a96bb70eb41f30d5d38b81a62e1fc03fd7a872
7
+ data.tar.gz: 3b50cf192e75592de311794b73af4ec7102ed32d6f68df27410dd14ee797f56ebb747e94a52737d121371d7653a1fbaee8c933a15a2a3f5dad4ca7d5f00aa272
@@ -1,6 +1,8 @@
1
1
  require 'active_support'
2
2
  require 'active_record'
3
+
3
4
  require_relative '../handlers/savings'
5
+ require_relative '../handlers/hooks'
4
6
 
5
7
  module Dsl
6
8
  module Savings
@@ -18,6 +20,12 @@ module Dsl
18
20
  Handlers::Savings.new(self).save!
19
21
  end
20
22
 
23
+ def validate!
24
+ Handlers::BeforeSaveHooks.handle(self)
25
+ super
26
+ @params
27
+ end
28
+
21
29
  def save
22
30
  save!
23
31
  rescue
@@ -10,7 +10,6 @@ module Handlers
10
10
  class Savings < Base
11
11
  def save!(&block)
12
12
  ActiveRecord::Base.transaction do
13
- before_save_hooks!
14
13
  @klass.validate!
15
14
  after_validations_hooks!
16
15
  block ? save_with_block!(block) : save_without_block!
@@ -22,10 +21,6 @@ module Handlers
22
21
  raise ActiveRecord::RecordInvalid.new(e.record)
23
22
  end
24
23
 
25
- def before_save_hooks!
26
- BeforeSaveHooks.handle(@klass)
27
- end
28
-
29
24
  def after_save_hooks!
30
25
  Delegates.handle(@klass)
31
26
  AfterSaveHooks.handle(@klass)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_form_objects
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michaël Villeneuve