act_form 0.3.1 → 0.3.2

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
  SHA1:
3
- metadata.gz: d7268ff41b24e1e8e2d261dcdf0f3897b2cfd486
4
- data.tar.gz: d54b5aaa9ce7c3f554f1363a11b9e6bdee2120c4
3
+ metadata.gz: 5babdc4d67ba9f0f77e948d4321d80af83ce8506
4
+ data.tar.gz: bc639b0fc776cc40bb18eb0970177583dbed6eea
5
5
  SHA512:
6
- metadata.gz: 5bb5e6f1d241079aeb70354f5ea8a11b681a368f5666820e20cbbbb446c556215e4a5f538f031158eb5288d0e00083704d7ee68396504f700bcb734941955f6b
7
- data.tar.gz: ef28b81f64dd99df42391460c6d2cf27de9c750d4d9e55f5411f31357149b8401eae07b1a1b119c02c1884ed2f35a131f91df92c86efafa82ce8836d1192b77f
6
+ metadata.gz: c74f8d7b5cb935be0bc908f0eff0a532b38d85b371e1b43945922d67f06bd61a48e7c0df14f153f40e98dc58728564536d74115300547c6207302c337a5d0fd3
7
+ data.tar.gz: 0cfa698b72430fb3b5d7441929e3df33c5d9b439a0694b17707bb373c48305f96c4f743f8c4327fba02e181c7a3d32f984ed010308f48b804af75855ca19a6b3
@@ -7,7 +7,8 @@ module ActForm
7
7
  include Model
8
8
  end
9
9
 
10
- class Command < Base
10
+ class Command
11
+ include Model
11
12
  include Runnable
12
13
  private_class_method :new
13
14
  end
@@ -19,17 +19,14 @@ module ActForm
19
19
  end
20
20
 
21
21
  def record=(record)
22
- if record.respond_to?(:attributes)
23
- @record = record
24
- else
25
- raise ArgumentError, 'Record must respond to attributes method!'
26
- end
22
+ raise ArgumentError, 'Record must respond to attributes method!' unless record.respond_to?(:attributes)
23
+ @record = record
27
24
  end
28
25
 
29
26
  # Record must respond_to attributes method
30
27
  def init_by(record, **attrs)
31
- @record = record
32
- _attrs = record.attributes.extract! *self.class.attribute_set.keys.map(&:to_s)
28
+ self.record = record
29
+ _attrs = record.attributes.extract! *self.class.attribute_set.keys.map(&:to_s)
33
30
  assign_attributes _attrs.merge(attrs)
34
31
  end
35
32
 
@@ -68,7 +65,6 @@ module ActForm
68
65
  end
69
66
 
70
67
  class_methods do
71
- private
72
68
  def inherited(child_class)
73
69
  child_class.include Combinable
74
70
  super
@@ -1,3 +1,3 @@
1
1
  module ActForm
2
- VERSION = '0.3.1'
2
+ VERSION = '0.3.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: act_form
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - zires
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-14 00:00:00.000000000 Z
11
+ date: 2018-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel