rows_controller 3.0.1 → 3.0.3

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
  SHA256:
3
- metadata.gz: f3f5302bbbcb8b8e673def7d44775cfbe769725798527b0242e04a6e4ba7b05b
4
- data.tar.gz: 85769005a96bb8692d33fbf509f27720c2bf3d19bdca62cbf295e2d09134d791
3
+ metadata.gz: 1ea282f99f4fadad36a5d7973f85373cde5d0a99bd4693b73ba4bb7022966d74
4
+ data.tar.gz: bff51320262e2bcc2853abf0825a4887177755af61d32340e07c38cd321f1a93
5
5
  SHA512:
6
- metadata.gz: 5e66beb546b78e41db7d4efa1078c0b09a53625928f42ba4b1e57ac343441db34227a63426a0c824afb5fe6cbb6963873da89127bff7c27cc4c2788e4a8d8319
7
- data.tar.gz: 11a4524c74e15a4df0aaabba28ca4cb984a1959c5cd63518a38c8d932fc3a2fa5f469a7cf9bc7ce3418f2af529f2463782cc45ec25b08baf414915414db244ed
6
+ metadata.gz: 6fc50f5cedbd36b6fc06c3bb71e489543629b0c9cc88b7fc7044d111d74d2f612189b0f6f686047975ecb8006a4acb4eb7e41a2cb77d01409e656d0b8eb1118f
7
+ data.tar.gz: 265a469734b8be2a4b6e1087470e0cdbc284b3d32de4591ee229c9ee0993fbe27487512ff10be84d52c76b35279bd80f37f0e512ebd47dd0f7370246a3f0ad17
@@ -1,4 +1,4 @@
1
- Copyright 2009-2018 Dittmar Krall http://matique.de
1
+ Copyright (c) 2012-2020 Dittmar Krall - www.matique.com
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -1,3 +1,5 @@
1
+ # rubocop: disable all
2
+
1
3
  module Rows
2
4
  class Engine < ::Rails::Engine
3
5
  end
@@ -1,5 +1,6 @@
1
- module Rows::Model
1
+ # frozen_string_literal: true
2
2
 
3
+ module Rows::Model
3
4
  def model_class
4
5
  @_model_class ||= self.class.model_class ||
5
6
  params[:controller].singularize.camelize.constantize
@@ -26,5 +27,4 @@ module Rows::Model
26
27
  def model_symbol_plural
27
28
  @_model_symbol_plural ||= model_symbol.pluralize
28
29
  end
29
-
30
30
  end
@@ -1,5 +1,6 @@
1
- module Rows::Resources
1
+ # frozen_string_literal: true
2
2
 
3
+ module Rows::Resources
3
4
  def set_resources(rows = nil)
4
5
  rows ||= model_class.all
5
6
  instance_variable_set("@#{model_symbol_plural}", rows)
@@ -21,8 +22,8 @@ module Rows::Resources
21
22
  end
22
23
 
23
24
  private
24
- # low level resource methods
25
- # can be monkey patched
25
+ # low level resource methods
26
+ # can be monkey patched
26
27
  def resource_new
27
28
  if params[model_symbol]
28
29
  set_resource model_class.new(resource_params)
@@ -38,7 +39,7 @@ module Rows::Resources
38
39
 
39
40
  def resource_update
40
41
  if Rails::VERSION::MAJOR >= 4
41
- # return true unless params[model_symbol]
42
+ # return true unless params[model_symbol]
42
43
  resource.update(resource_params)
43
44
  else
44
45
  resource.update_attributes(resource_params)
@@ -50,8 +51,8 @@ module Rows::Resources
50
51
  end
51
52
 
52
53
  def resource_columns
53
- return model_class.column_headers if model_class.respond_to?(:column_headers)
54
- return ['to_s'] unless model_class.respond_to?(:content_columns)
54
+ return model_class.column_headers if model_class.respond_to?(:column_headers)
55
+ return ['to_s'] unless model_class.respond_to?(:content_columns)
55
56
 
56
57
  ['id'] + model_class.content_columns.collect(&:name)
57
58
  end
@@ -70,7 +71,7 @@ module Rows::Resources
70
71
  pars = params[model_symbol] || {}
71
72
  pars.keys.each { |x|
72
73
  x = x.to_sym
73
- unless permits.include?(x) || permits.include?({ x => [] })
74
+ unless permits.include?(x) || permits.include?({x => []})
74
75
  pars.delete(x)
75
76
  p "** WARNING: model <#{model_name}> dropping params <#{x}>"
76
77
  end
@@ -78,5 +79,4 @@ module Rows::Resources
78
79
  pars
79
80
  end
80
81
  end
81
-
82
82
  end
@@ -1,14 +1,17 @@
1
- module Rows::Utils
1
+ # frozen_string_literal: true
2
+ # rubocop: disable all
2
3
 
3
- # formatting
4
+ module Rows::Utils
5
+ # formatting
4
6
  def resource_format(x)
5
7
  return '--'.html_safe if x.nil?
6
8
 
7
9
  bool = x.class == Time || x.class == Date || x.class == DateTime ||
8
10
  x.class == ActiveSupport::TimeWithZone
9
- return x.strftime('%d.%m.%Y').html_safe if bool
10
- # return I18n.l(x) if bool
11
- # return x.to_s.html_safe if x.class == Fixnum
11
+ return x.strftime('%d.%m.%Y').html_safe if bool
12
+
13
+ # return I18n.l(x) if bool
14
+ # return x.to_s.html_safe if x.class == Fixnum
12
15
  return x.to_s.html_safe if x.is_a?(Integer)
13
16
  return 'X'.html_safe if x.class == TrueClass
14
17
  return '&ensp;'.html_safe if x.class == FalseClass
@@ -1,6 +1,10 @@
1
+ # rubocop: disable all
2
+
1
3
  module Rows
2
- VERSION = '3.0.1'.freeze # 2020-03-01
3
- # VERSION = '3.0.0'.freeze # 2019-10-03
4
+ VERSION = '3.0.3' # 2020-07-14
5
+ # VERSION = '3.0.2' # 2020-04-27
6
+ # VERSION = '3.0.1' # 2020-03-01
7
+ # VERSION = '3.0.0' # 2019-10-03
4
8
  # VERSION = '2.2.3' # 2019-10-03
5
9
  # VERSION = '2.2.2' # 2019-05-06
6
10
  # VERSION = '2.2.1' # 2019-02-18
@@ -1,7 +1,11 @@
1
+ # rubocop: disable all
2
+
1
3
  module Rows
2
- VERSION = '3.0.0'.freeze # 2019-10-03
3
- # VERSION = '2.2.3' # 2019-10-03
4
- # VERSION = '2.2.2' # 2019-05-06
5
- # VERSION = '2.2.1' # 2019-02-18
6
- # VERSION = '2.2.0'
4
+ VERSION = '3.0.2' # 2020-04-27
5
+ # VERSION = '3.0.1' # 2020-03-01
6
+ # VERSION = '3.0.0' # 2019-10-03
7
+ # VERSION = '2.2.3' # 2019-10-03
8
+ # VERSION = '2.2.2' # 2019-05-06
9
+ # VERSION = '2.2.1' # 2019-02-18
10
+ # VERSION = '2.2.0'
7
11
  end
@@ -1,3 +1,5 @@
1
+ # rubocop: disable all
2
+
1
3
  require 'rows/engine'
2
4
 
3
5
  module Rows
metadata CHANGED
@@ -1,43 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rows_controller
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dittmar Krall
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-01 00:00:00.000000000 Z
11
+ date: 2020-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '1'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: '1'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '13'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: '13'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: appraisal
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -70,30 +70,30 @@ dependencies:
70
70
  name: minitest
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: '5'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: '5'
83
83
  - !ruby/object:Gem::Dependency
84
- name: simplecov
84
+ name: sqlite3
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '0'
89
+ version: '1'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '0'
96
+ version: '1'
97
97
  description: YourController < RowsController ( < ApplicationController).
98
98
  email:
99
99
  - dittmar.krall@matique.de