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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2050a07f362b1b5070054ffd7666cf99003c3097
4
- data.tar.gz: 60836c74021de139a972d2f852e0dc71c60f2a06
3
+ metadata.gz: de83bc286808898584e1f80bc15df54beec4dfa9
4
+ data.tar.gz: efc13484d6d1d8ed120b7c30d273703b45d794cd
5
5
  SHA512:
6
- metadata.gz: 4325099dbdd0a0250333ad61d72c4e843cfff1833784aa5c905a679646a2a5f8fb48a102491bccf88ac42e2b95e8104bf4a2adcf6062e15183eceea6e015453d
7
- data.tar.gz: f95feaa7614f4db2b6774e2d487b804df43f033eedb215179d16d2d14f0a0701947a627d2b570940b99e1d76ba9edc5cf6ece3b8e0ec482f37786dec975c7b7f
6
+ metadata.gz: 93b830257e2b00cf6b1e74e8747b309215975485aba94fca6ab54aa3e9ef5fdfbcb9bcc3c03ae695632d33b8d5f2880ddea7cf68cf092825be779fe80eb137b0
7
+ data.tar.gz: 850b696cd23ca17f6438f1840a93fed66fb5a441e542be67ba9024ae1ba2f2ca30927db357501aeca6ca2e804a45e5d9f3a01232c820531dbf74f0f4b99cd468
@@ -1,3 +1,3 @@
1
1
  module ModelBase
2
- VERSION = "0.3.8"
2
+ VERSION = "0.3.9"
3
3
  end
@@ -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.8
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: 2016-11-12 00:00:00.000000000 Z
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.1
392
+ rubygems_version: 2.5.2
393
393
  signing_key:
394
394
  specification_version: 4
395
395
  summary: Provide generators for models with assocations.