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 +4 -4
- data/CHANGELOG.md +3 -1
- data/README.md +6 -0
- data/lib/generators/logidze/model/model_generator.rb +3 -1
- data/lib/logidze/version.rb +1 -1
- 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: 17de700c04926cec63c3498e6568b889cfd240b9
|
4
|
+
data.tar.gz: 3dd305a8537eec34a7c68f0c318b9150b162205d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc4e0b72623d6d7419e444c973ea01138eccd9b41e21a4712323f2ee2a88df5389fa13acc7ad9be00d96e50b272c7c2ab3d98e85f180f96c294b0f834a8cebf1
|
7
|
+
data.tar.gz: 12c1f0cb5e81aba650a91a840a1911831219c8f5a9c972024f976d8369abd277156851212c5c4ce6ef143e9fe359e44ee6576e9b2b79e00083da1b01a717fd9b
|
data/CHANGELOG.md
CHANGED
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
|
data/lib/logidze/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2017-02-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|