simple_form_object 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/simple_form_object.rb +4 -0
- data/lib/simple_form_object/version.rb +1 -1
- data/spec/model_spec.rb +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a296fd822ede70ffc73dd3a74f80fc7a6e733de
|
4
|
+
data.tar.gz: 2137e4348acee463f2262314afeae2d4c2b180a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 307c4eeba567865fa817b82ff6cf3aa2e0d9f96b230480bc83532ca4fb23365e96cac294c3f63ea39133a6dfd528b69dcf30cb527569486daa4bd9957359b25a
|
7
|
+
data.tar.gz: d3497b99bdc805b3c341b3e99a2dd69041fd7f4b5141b1633bc1f67a5354ec492925e15df24c9148be5fff63db66d7cbdbaf9e18de7bef44371f4fe79f8de7e8
|
data/lib/simple_form_object.rb
CHANGED
@@ -70,6 +70,10 @@ module SimpleFormObject
|
|
70
70
|
self.class._attribute(attribute).fake_column
|
71
71
|
end
|
72
72
|
|
73
|
+
def has_attribute?(attribute_name)
|
74
|
+
self.class._attribute(attribute_name).present?
|
75
|
+
end
|
76
|
+
|
73
77
|
def initialize(attributes={})
|
74
78
|
super
|
75
79
|
self.class._attributes.each do |attribute|
|
data/spec/model_spec.rb
CHANGED
@@ -39,6 +39,10 @@ describe 'SimpleFormObject' do
|
|
39
39
|
it 'should return a fake column with the correct type' do
|
40
40
|
expect(instance.column_for_attribute(attr).type).to eq type
|
41
41
|
end
|
42
|
+
|
43
|
+
it 'should say that the attribute exists' do
|
44
|
+
expect(instance.has_attribute?(attr)).to eq true
|
45
|
+
end
|
42
46
|
end
|
43
47
|
|
44
48
|
describe 'options' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_form_object
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leonard Garvey
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|