simple_text 0.0.17 → 0.0.18

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d31dd8cd522df8036941fa8b352c4d454205406c
4
- data.tar.gz: a31ab3ff69c1189e89b3d504abc2e8a37cec3556
3
+ metadata.gz: 840d9da92b00626a852cc9c61f217d1db94b4395
4
+ data.tar.gz: 77822454a6a2ae30c2aa41b84b5818e39e378502
5
5
  SHA512:
6
- metadata.gz: b804e4cd009dcf6abdd0c351711a469e9d89c0cfcaba703a3586aa2784667875fdea49b6c6d1302312c5c70cf4aa10196ecaf4f2ca4f02b3345bab6eae4d9257
7
- data.tar.gz: 8be57a2b26b7f039a8f460678412f59dd72f5aad4ba262bdf75612dab3b5d5b9a5b4e0f7c3b6f300875d3fcbe6733c73c27c1d169b7e203be99797b222857533
6
+ metadata.gz: 748d78721eaab520d5d2f62f3c2c87edc3a17402df044fb907312b91e352703dc23a7e3a4cb1a5f2afc08ad0a4639515417d74f8fc9fb03f44cddb731cb49098
7
+ data.tar.gz: 8fdde36697457167a63dc05b5538683da6bea29aa46296a317bb7518af1e8319a88bbd097ceb1335347ab1e07f4195f793e174156ab626360b83c4b60e249960
data/README.md CHANGED
@@ -6,6 +6,7 @@ Generate the migration and run migrations:
6
6
  rake simple_text:migrations:install
7
7
  rake db:migrate
8
8
  ```
9
+ Which will generate a migration for the `documents` table.
9
10
 
10
11
  Optionally, add the SimpleText css to your `application.css`
11
12
  ```Ruby
@@ -21,3 +22,27 @@ If you've created a document, add the public route to your routes:
21
22
  ```Ruby
22
23
  get '/disclaimer', to: 'documents#show', name: 'disclaimer'
23
24
  ```
25
+
26
+ ## Overriding the default controller
27
+ For certain functionality, overriding the `DocumentsController` is required, e.g. to make [Pundit](https://github.com/elabs/pundit) work:
28
+ ```Ruby
29
+ class DocumentsController < SimpleText::DocumentsController
30
+ after_action :verify_authorized, :except => :index
31
+ after_action :verify_policy_scoped, :only => :index
32
+ after_action :make_authorized, except: :index
33
+ after_action :make_scoped, only: :index
34
+
35
+ def make_authorized
36
+ authorize @document
37
+ end
38
+
39
+ def make_scoped
40
+ policy_scope @documents
41
+ end
42
+ end
43
+ ```
44
+
45
+ ## Some TODO's
46
+ - Make the model name changable.
47
+ - Write tests.
48
+ - Make integration of [Whodunnit](https://github.com/fletcher91/whodunnit) optional via config
@@ -16,6 +16,10 @@
16
16
  }
17
17
  }
18
18
 
19
+ strong {
20
+ font-weight: bold;
21
+ }
22
+
19
23
  address {
20
24
  white-space: pre;
21
25
  }
@@ -1,7 +1,5 @@
1
1
  module SimpleText
2
2
  class Engine < ::Rails::Engine
3
- #isolate_namespace SimpleText
4
-
5
3
  initializer "simple_text.load_helpers" do |app|
6
4
  ActionController::Base.send :include, SimpleText::ApplicationHelper
7
5
  end
@@ -1,3 +1,3 @@
1
1
  module SimpleText
2
- VERSION = "0.0.17"
2
+ VERSION = "0.0.18"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_text
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.17
4
+ version: 0.0.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fletcher91