tramway-core 1.9.6.1 → 1.9.7

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 567ea16b9b30c8c03180a8300f7a63d95723a04702eb764b0e79c6aab6394d16
4
- data.tar.gz: b9732ea5536fc2315b2dfa42184e972250a9884052225b0138c0b234be565843
3
+ metadata.gz: df6a328c279dd1871957bf8851a856080ba81d2ce9fc8c4721ff05d4e5331611
4
+ data.tar.gz: fafad584ace4ddfeadb2865ff695758bf82adcc06a19ca2ef30d1aade5a083ac
5
5
  SHA512:
6
- metadata.gz: 953394c484dd89b2f26f6274beff2ad5423bd532d250f3f219444785c7f02e41ab0321f2d875d8887ac71e122a469865031b989c3468a9f8cb56c4964c16fd76
7
- data.tar.gz: 848e488753cb7cdd250b8af7268f0bacd5c1b9dae684990d085fc8772896dc31f70f9ae94019f1db60a5c3927caeb4d6a0e4ffd322e64aaf4ab3485b8879e512
6
+ metadata.gz: 842b72abd33c0c7e8bd4024551101ad34df8bea2bb90e8dc3a1abd9ed6afcabb5de8ad2b7408443ee25e32256e71921adbb3f372f2bb245556cb1f0c25b97f73
7
+ data.tar.gz: 9694d549f73d6728b7cb599cf882b44bebd1196aa4bea48625a0803148d7fb65edcaebc10034ce3d8ce216159b918ca730b1b8ab6ca81c395f1176c943520fa8
@@ -1,6 +1,7 @@
1
1
  module Tramway::Core
2
2
  class ApplicationForm < ::Reform::Form
3
- def initialize(object)
3
+ def initialize(object = nil)
4
+ object = self.class.model_class.new unless object
4
5
  super(object).tap do
5
6
  @@model_class = object.class
6
7
  @@enumerized_attributes = object.class.try :enumerized_attributes
@@ -101,7 +102,7 @@ module Tramway::Core
101
102
  end
102
103
 
103
104
  def model_class
104
- if @@model_class
105
+ if defined?(@@model_class) && @@model_class
105
106
  @@model_class
106
107
  else
107
108
  model_class_name ||= self.name.to_s.sub(/Form$/, '')
@@ -1,5 +1,5 @@
1
1
  module Tramway
2
2
  module Core
3
- VERSION = '1.9.6.1'
3
+ VERSION = '1.9.7'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tramway-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.6.1
4
+ version: 1.9.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Kalashnikov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-23 00:00:00.000000000 Z
11
+ date: 2019-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: reform-rails