model_base_generators 0.3.8 → 0.3.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/model_base/version.rb +1 -1
- data/lib/templates/factory_girl/factory.rb +11 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de83bc286808898584e1f80bc15df54beec4dfa9
|
4
|
+
data.tar.gz: efc13484d6d1d8ed120b7c30d273703b45d794cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93b830257e2b00cf6b1e74e8747b309215975485aba94fca6ab54aa3e9ef5fdfbcb9bcc3c03ae695632d33b8d5f2880ddea7cf68cf092825be779fe80eb137b0
|
7
|
+
data.tar.gz: 850b696cd23ca17f6438f1840a93fed66fb5a441e542be67ba9024ae1ba2f2ca30927db357501aeca6ca2e804a45e5d9f3a01232c820531dbf74f0f4b99cd468
|
data/lib/model_base/version.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
<%- unless ModelBase.config.frozen_string_literal.nil? -%>
|
2
2
|
# frozen_string_literal: <%= ModelBase.config.frozen_string_literal.inspect %>
|
3
3
|
<%- end -%>
|
4
|
+
<%- columns = model.columns_for(:factory) rescue nil-%>
|
5
|
+
<%- if columns -%>
|
4
6
|
FactoryGirl.define do
|
5
7
|
factory :<%= model.full_resource_name %> do
|
6
8
|
<%- model.columns_for(:factory).each do |col| -%>
|
@@ -16,3 +18,12 @@ FactoryGirl.define do
|
|
16
18
|
<%- end -%>
|
17
19
|
end
|
18
20
|
end
|
21
|
+
<%- else -%>
|
22
|
+
FactoryGirl.define do
|
23
|
+
factory :<%= singular_table_name %><%= explicit_class_option %> do
|
24
|
+
<%- attributes.map do |attribute| -%>
|
25
|
+
<%= attribute.name %> <%= attribute.default.inspect %>
|
26
|
+
<%- end -%>
|
27
|
+
end
|
28
|
+
end
|
29
|
+
<%- end -%>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: model_base_generators
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- akm
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -389,7 +389,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
389
389
|
version: '0'
|
390
390
|
requirements: []
|
391
391
|
rubyforge_project:
|
392
|
-
rubygems_version: 2.5.
|
392
|
+
rubygems_version: 2.5.2
|
393
393
|
signing_key:
|
394
394
|
specification_version: 4
|
395
395
|
summary: Provide generators for models with assocations.
|