growth 0.1.7 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/app/controllers/growth/stats_controller.rb +1 -1
- data/app/helpers/growth/application_helper.rb +2 -0
- data/lib/generators/templates/growth.rb +3 -3
- data/lib/growth.rb +2 -3
- data/lib/growth/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: b6ba36ed28a1a468536f96321c036a2a12658e58
|
4
|
+
data.tar.gz: f56cd0f551134a2eb4b9c8a38c5bb8e92774075d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1d9f13fe4712e543014d961bc6c5f5543b329a722276b91e02baaed155216384128a121195dd11b52220349202127b7fdd9d44cf8918047e04064cc0c70889e
|
7
|
+
data.tar.gz: badd962a8bcba94692708c0ca24196acd3c5a2d4475ce4793f0894d51b8b882adabed07b69701adb2f4b4bd57f460526846adf72a750640fee9a355955d938ae
|
data/README.md
CHANGED
@@ -33,17 +33,17 @@ end
|
|
33
33
|
Growth.models_to_measure = ApplicationRecord.descendants.map { |model| model.to_s }
|
34
34
|
```
|
35
35
|
|
36
|
-
You can customize the models you'd like to measure by passing an array of models, i.e.:
|
36
|
+
You can customize the models you'd like to measure by passing an array of models as strings, i.e.:
|
37
37
|
|
38
38
|
```ruby
|
39
|
-
Growth.models_to_measure = [ User, Post, Comment ]
|
39
|
+
Growth.models_to_measure = [ 'User', 'Post', 'Comment' ]
|
40
40
|
```
|
41
41
|
|
42
42
|
Options in your config file are:
|
43
43
|
|
44
|
-
```Growth.models_to_measure``` takes an array of models, ex. [Posts, Users, Comments], that you'd like to measure. The default measures all models.
|
44
|
+
```Growth.models_to_measure``` takes an array of models as strings, ex. [ 'Posts', 'Users', 'Comments' ], that you'd like to measure. The default measures all models.
|
45
45
|
|
46
|
-
```Growth.model_blacklist``` takes an array of models, ex. [AdminUsers], that you want to prevent the gem from measuring.
|
46
|
+
```Growth.model_blacklist``` takes an array of models, ex. [ 'AdminUsers' ], that you want to prevent the gem from measuring.
|
47
47
|
|
48
48
|
```Growth.username ``` is your username for http_basic_auth
|
49
49
|
|
@@ -6,7 +6,7 @@ require_dependency "growth/transactions/generate_retention_report"
|
|
6
6
|
module Growth
|
7
7
|
class StatsController < ApplicationController
|
8
8
|
def index
|
9
|
-
resources = Growth.models_to_measure
|
9
|
+
resources = Growth.models_to_measure.map(&:constantize)
|
10
10
|
|
11
11
|
render :index, locals: {year: get_year, resources: resources}
|
12
12
|
end
|
@@ -1,13 +1,13 @@
|
|
1
1
|
Growth.setup do |config|
|
2
2
|
# Default: Measures all models.
|
3
|
-
# models_to_measure takes an array of Rails models, for example:
|
3
|
+
# models_to_measure takes an array of Rails models as strings, for example:
|
4
4
|
#
|
5
|
-
# Growth.models_to_measure = [ User, Product, Order, Payment ]
|
5
|
+
# Growth.models_to_measure = [ 'User', 'Product', 'Order', 'Payment' ]
|
6
6
|
|
7
7
|
# Default: Prevent specific models from being measured
|
8
8
|
# model_blacklist takes an array of Rails models, for example:
|
9
9
|
#
|
10
|
-
# Growth.model_blacklist = [ AdminUser ]
|
10
|
+
# Growth.model_blacklist = [ 'AdminUser' ]
|
11
11
|
|
12
12
|
# This is your username for securing the '/growth' route
|
13
13
|
# You will be prompted to enter this when viewing the page
|
data/lib/growth.rb
CHANGED
@@ -3,11 +3,10 @@ require "growth/engine"
|
|
3
3
|
module Growth
|
4
4
|
mattr_accessor :username
|
5
5
|
mattr_accessor :password
|
6
|
-
|
7
6
|
mattr_accessor :model_blacklist
|
8
|
-
|
7
|
+
mattr_writer :models_to_measure
|
9
8
|
|
10
|
-
|
9
|
+
@@model_blacklist = []
|
11
10
|
|
12
11
|
def self.models_to_measure
|
13
12
|
@@models_to_measure ||= ::ActiveRecord::Base.descendants.map(&:name) - ::ActiveRecord::Base.send(:subclasses).map(&:name)
|
data/lib/growth/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: growth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Friedman
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2019-06-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|