tramway-core 1.0.6 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/forms/tramway/core/extendable_form.rb +20 -0
- data/lib/tramway/core/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 24a4a0a529963201bd89848634411b031498730868040a6fcfeae1375f57a97b
|
4
|
+
data.tar.gz: a624cdc01cda2ef6041c7e0b6468ce9a5a9a5fea63a6ca2bbaff307df02a2927
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe24234c734d1ac32d22f1a3673d294b3321c0d6a60eae06c6df5eb1dbab07c88833a4ecdbcfb2551528f083952830841c11d183d788765eac0c055f5fbabb22
|
7
|
+
data.tar.gz: 2d84cb51332baa0ef70a1556ff8afadfa0207ee817d26abab9b4e5facb301292e4dcfad77d8ed82cb7b152c937b73ab3c4aef633670e1665448ce43268d64bad
|
@@ -0,0 +1,20 @@
|
|
1
|
+
class Tramway::Core::ExtendableForm
|
2
|
+
class << self
|
3
|
+
def new(name, *more_properties)
|
4
|
+
Object.const_set(name, Class.new(::Tramway::Core::ApplicationForm) do
|
5
|
+
more_properties.each do |property|
|
6
|
+
|
7
|
+
define_method property do
|
8
|
+
model.values[property] if model.values
|
9
|
+
end
|
10
|
+
|
11
|
+
define_method "#{property}=" do |value|
|
12
|
+
model.values ||= {}
|
13
|
+
model.values.merge! property => value
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/tramway/core/version.rb
CHANGED
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.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pavel Kalashnikov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: reform-rails
|
@@ -223,6 +223,7 @@ files:
|
|
223
223
|
- app/decorators/tramway/core/application_decorated_collection.rb
|
224
224
|
- app/decorators/tramway/core/application_decorator.rb
|
225
225
|
- app/forms/tramway/core/application_form.rb
|
226
|
+
- app/forms/tramway/core/extendable_form.rb
|
226
227
|
- app/models/tramway/core/application_record.rb
|
227
228
|
- app/uploaders/application_uploader.rb
|
228
229
|
- app/uploaders/file_uploader.rb
|