rows_controller 2.1.2 → 2.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/app/controllers/rows_controller.rb +4 -1
- data/lib/rows/version.rb +1 -1
- data/test/controllers/orders_test.rb +13 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b2cc798e5dc9ded7fb4cdc3c602b7ae710b909bb7f36d1d472ba438cd4c0706
|
4
|
+
data.tar.gz: 192b9b6d5425a63ce8b856dfe51776594ea9b94e9da27917ced430df2f165ba8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be0bbd12361d9e729911efa4c719f64dad136cf6dfc9f3fbcafb558452ddb08e600ad2ef9b4765c7f6724d671750621a69db3d8b29f6dfda9665eaeda78e6a5c
|
7
|
+
data.tar.gz: c2c164ce9de789f45b1b1620bddaa7ef5c35afef64eaf22c0c67ca40ea482918fd759833706dec5ea4080190e8d33f39579bb8919aa33a2dc0f7532c7ba71732
|
data/Gemfile.lock
CHANGED
@@ -14,7 +14,10 @@ class RowsController < ApplicationController
|
|
14
14
|
|
15
15
|
def self.model_class(model_class = nil)
|
16
16
|
@_model_class ||= nil
|
17
|
-
|
17
|
+
unless model_class.nil?
|
18
|
+
@_model_class = model_class
|
19
|
+
@_model_class = model_class.constantize if model_class.is_a?(String)
|
20
|
+
end
|
18
21
|
@_model_class
|
19
22
|
end
|
20
23
|
|
data/lib/rows/version.rb
CHANGED
@@ -7,6 +7,13 @@ class OrdersControllerTest < ActionController::TestCase
|
|
7
7
|
|
8
8
|
def setup
|
9
9
|
@order = orders(:one)
|
10
|
+
OrdersController.model_class Order # reset
|
11
|
+
end
|
12
|
+
|
13
|
+
test 'self.model_class assignment' do
|
14
|
+
test_model_class Integer, Integer
|
15
|
+
test_model_class "String", String
|
16
|
+
test_model_class "ActiveSupport::TimeWithZone", ActiveSupport::TimeWithZone
|
10
17
|
end
|
11
18
|
|
12
19
|
%i{ index new }.each do |action|
|
@@ -80,4 +87,10 @@ class OrdersControllerTest < ActionController::TestCase
|
|
80
87
|
assert_template 'rows/new'
|
81
88
|
end
|
82
89
|
|
90
|
+
private
|
91
|
+
def test_model_class(asgn, klass)
|
92
|
+
OrdersController.model_class asgn
|
93
|
+
assert_equal klass, OrdersController.model_class
|
94
|
+
end
|
95
|
+
|
83
96
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rows_controller
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dittmar Krall
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|