doc_contract 0.1.4 → 0.1.6

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
  SHA256:
3
- metadata.gz: fb6f6bf75e0e4c9b9ea09c49146edba377b3346c5fcc8e9f7e9ecf932b422447
4
- data.tar.gz: 52c2ed3b75132578ec81071c6ebf994c99ca6e814533c4acbbc76cfeacd8da38
3
+ metadata.gz: 10539557dfc2459c982fd3f6eb174e5012e5d7db7cf4001a38f684ce96d758cb
4
+ data.tar.gz: 5417b3780907dacd938cbb937b87381b1218ac839fcbfe7f6f6a6611ff08f006
5
5
  SHA512:
6
- metadata.gz: dae1bda1cdd2890eba9cbf67eaf58e04aa4d12ea8eb5afbf99665a4d6c7f20f1f16d3596082e7ea19f2f1bd53219ffb51d38f37d5a9491cb765d3b75466aad21
7
- data.tar.gz: d8cd507880bb8cfce24e98f7a1da83672290bcdd3de9ef0547159f5d9baaaba4f7c9c1bf59142c67be4e09595a9f23debebd753e492ee4d00ba06a6e84970934
6
+ metadata.gz: 9fa4bb103d56400fd0599ccba7a20e475583ea704e7bcf20eb306960aa0d82b29c86f5e83cbcba6f38caaa3a76643000f9c1f04308148f5fa98d2344d9c4548d
7
+ data.tar.gz: 431cb7417342a0ff44f31040ec78f2dd7798882d5bedfb29159fc4ac8795f726de11fa5063b4e9209fe015c0cf951f12eb86c2579731681b4d7dd3451526ae0a
@@ -1,6 +1,7 @@
1
1
  module DocContract
2
2
  class ApplicationController < ApplicationController
3
3
  helper_method :query, :readme_html
4
+
4
5
  def main
5
6
  end
6
7
 
@@ -7,7 +7,7 @@ module DocContract
7
7
  def index
8
8
  authorize! :index, record_class
9
9
  @q = record_class.ransack query
10
- @q.sorts = "created_at desc" if @q.sorts.empty?
10
+ @q.sorts = 'name asc' if @q.sorts.empty?
11
11
  @records = @q.result.includes(:contract_template).page(params[:page]).per(100)
12
12
  respond_with(@records)
13
13
  end
@@ -7,7 +7,7 @@ module DocContract
7
7
  def index
8
8
  authorize! :index, record_class
9
9
  @q = record_class.ransack query
10
- @q.sorts = 'created_at desc' if @q.sorts.empty?
10
+ @q.sorts = 'name asc' if @q.sorts.empty?
11
11
  @records = @q.result.page(params[:page]).per(100)
12
12
  respond_with(@records)
13
13
  end
@@ -4,7 +4,7 @@ module DocContract
4
4
  belongs_to :contract_template
5
5
 
6
6
  def config
7
- own_config = YAML.load(config_yml.to_s) || {}
7
+ own_config = YAML.safe_load(config_yml.to_s, permitted_classes: [Symbol, Date]) || {}
8
8
  own_config.reverse_merge contract_template.config
9
9
  end
10
10
 
@@ -7,7 +7,7 @@ module DocContract
7
7
  validates :config_yml, yaml: true
8
8
 
9
9
  def config
10
- YAML.load(config_yml.to_s) || {}
10
+ YAML.safe_load(config_yml.to_s, permitted_classes: [Symbol, Date]) || {}
11
11
  end
12
12
 
13
13
  def processed_markdown(config_addittions = {})
@@ -6,8 +6,8 @@
6
6
  table.ui.compact.top.attached.striped.table
7
7
  thead
8
8
  tr
9
- th= at :name
10
- th= DocContract::ContractTemplate.model_name.human
9
+ th= sort_link @q, :name, at(:name), default_order: :asc
10
+ th= sort_link @q, :contract_template_name, DocContract::ContractTemplate.model_name.human
11
11
  th.column-filter.actions
12
12
  = search_result_info @records
13
13
  = search_row class: 'ui mini form' do
@@ -6,7 +6,7 @@
6
6
  table.ui.compact.top.attached.striped.table
7
7
  thead
8
8
  tr
9
- th= at :name
9
+ th= sort_link @q, :name, at(:name), default_order: :asc
10
10
  th.column-filter.actions
11
11
  = search_result_info @records
12
12
  = search_row class: 'ui mini form' do
@@ -1,5 +1,7 @@
1
1
  require 'numbers_and_words'
2
+ require 'cancancan'
2
3
  require 'ransack'
4
+ require 'kaminari'
3
5
  module DocContract
4
6
  class Engine < ::Rails::Engine
5
7
  #isolate_namespace self.name.deconstantize.safe_constantize
@@ -1,3 +1,3 @@
1
1
  module DocContract
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: doc_contract
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benjamin ter Kuile