logidze 0.4.0 → 0.4.1

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: 34c35c39f7c5dc042b1c13298bdb0347f6d2c811
4
- data.tar.gz: c4e3a0f86bdb6fcffa45286d55a4d42a59343074
3
+ metadata.gz: 17de700c04926cec63c3498e6568b889cfd240b9
4
+ data.tar.gz: 3dd305a8537eec34a7c68f0c318b9150b162205d
5
5
  SHA512:
6
- metadata.gz: 29f671a66d9fe528c17baa1416f803a4aba38f0e58e5a4cad5398c28641212c4b956a29004f225babe10ca35c9690e17b1c9d6e5576339d1358ae56f1b4e728a
7
- data.tar.gz: 438261164cf4ea8c792ab089cc0cbafdff31c3086c12025f0fe35907b3a5efbbd5882563eebeec50ce8954b83d788c3a688077246077a90f65fe05845465640d
6
+ metadata.gz: bc4e0b72623d6d7419e444c973ea01138eccd9b41e21a4712323f2ee2a88df5389fa13acc7ad9be00d96e50b272c7c2ab3d98e85f180f96c294b0f834a8cebf1
7
+ data.tar.gz: 12c1f0cb5e81aba650a91a840a1911831219c8f5a9c972024f976d8369abd277156851212c5c4ce6ef143e9fe359e44ee6576e9b2b79e00083da1b01a717fd9b
data/CHANGELOG.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # Change log
2
2
 
3
- ## master
3
+ ## 0.4.1 (2017-02-06)
4
+
5
+ - Add `--path` option to model migration generator. ([@palkan][])
4
6
 
5
7
  ## 0.4.0 (2017-01-14)
6
8
 
data/README.md CHANGED
@@ -69,6 +69,12 @@ rails generate logidze:model Post --blacklist=created_at active
69
69
  rails generate logidze:model Post --whitelist=title body
70
70
  ```
71
71
 
72
+ By default, Logidze tries to infer the path to the model file from the model name and may fail, for example, if you have unconventional project structure. In that case you should specify the path explicitly:
73
+
74
+ ```ruby
75
+ rails generate logidze:model Post --path "app/models/custom/post.rb"
76
+ ```
77
+
72
78
  ## Troubleshooting
73
79
 
74
80
  The most common problem is `"permission denied to set parameter "logidze.xxx"` caused by `ALTER DATABASE ...` query.
@@ -15,6 +15,8 @@ module Logidze
15
15
  class_option :only_trigger, type: :boolean, optional: true,
16
16
  desc: "Create trigger-only migration"
17
17
 
18
+ class_option :path, type: :string, optional: true, desc: "Specify path to the model file"
19
+
18
20
  class_option :blacklist, type: :array, optional: true
19
21
  class_option :whitelist, type: :array, optional: true
20
22
 
@@ -89,7 +91,7 @@ module Logidze
89
91
  private
90
92
 
91
93
  def model_file_path
92
- File.join("app", "models", "#{file_path}.rb")
94
+ options[:path] || File.join("app", "models", "#{file_path}.rb")
93
95
  end
94
96
  end
95
97
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Logidze
3
- VERSION = "0.4.0"
3
+ VERSION = "0.4.1"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logidze
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - palkan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-14 00:00:00.000000000 Z
11
+ date: 2017-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails