we_bridge-auto_view_helper 0.0.7 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +1 -1
- data/Gemfile +3 -0
- data/Gemfile.lock +43 -3
- data/lib/we_bridge/auto_view_helper.rb +1 -1
- data/lib/we_bridge/auto_view_helper/controller.rb +10 -4
- data/lib/we_bridge/auto_view_helper/version.rb +1 -1
- data/we_bridge-auto_view_helper.gemspec +2 -0
- metadata +30 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cbba39712b7aace911121f61c465a5180dd8ad4f
|
4
|
+
data.tar.gz: 0017b27689dc7349d19526a6fec05f68f06d122f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 807839462020c4818f076db6a40a43942f389ae83f364837ecd6656eb8963cbd51d793dd145092aca38379832f22e6e7e72a263864db8d4e037579f49a998555
|
7
|
+
data.tar.gz: 81938e9707dda8ede9340616cc97938c899693dbf6be266661ec4a32649e4cd4ca3965356775f7ef4e87f34419a37900c26bbdcd8a109f9dae2b0cff2b04e488
|
data/.rspec
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,28 +1,47 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
we_bridge-auto_view_helper (0.
|
4
|
+
we_bridge-auto_view_helper (0.0.8)
|
5
5
|
actionview
|
6
6
|
actionview-helpers-auto_tag_helper
|
7
|
+
activerecord-mlang
|
7
8
|
|
8
9
|
GEM
|
9
10
|
remote: https://rubygems.org/
|
10
11
|
specs:
|
12
|
+
actionpack (4.2.3)
|
13
|
+
actionview (= 4.2.3)
|
14
|
+
activesupport (= 4.2.3)
|
15
|
+
rack (~> 1.6)
|
16
|
+
rack-test (~> 0.6.2)
|
17
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
18
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
11
19
|
actionview (4.2.3)
|
12
20
|
activesupport (= 4.2.3)
|
13
21
|
builder (~> 3.1)
|
14
22
|
erubis (~> 2.7.0)
|
15
23
|
rails-dom-testing (~> 1.0, >= 1.0.5)
|
16
24
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
17
|
-
actionview-helpers-auto_tag_helper (0.1.
|
25
|
+
actionview-helpers-auto_tag_helper (0.1.2)
|
18
26
|
actionview
|
19
27
|
activesupport (>= 4.2.3)
|
28
|
+
activemodel (4.2.3)
|
29
|
+
activesupport (= 4.2.3)
|
30
|
+
builder (~> 3.1)
|
31
|
+
activerecord (4.2.3)
|
32
|
+
activemodel (= 4.2.3)
|
33
|
+
activesupport (= 4.2.3)
|
34
|
+
arel (~> 6.0)
|
35
|
+
activerecord-mlang (0.0.6)
|
36
|
+
activerecord
|
37
|
+
i18n
|
20
38
|
activesupport (4.2.3)
|
21
39
|
i18n (~> 0.7)
|
22
40
|
json (~> 1.7, >= 1.7.7)
|
23
41
|
minitest (~> 5.1)
|
24
42
|
thread_safe (~> 0.3, >= 0.3.4)
|
25
43
|
tzinfo (~> 1.1)
|
44
|
+
arel (6.0.3)
|
26
45
|
builder (3.2.2)
|
27
46
|
diff-lcs (1.2.5)
|
28
47
|
erubis (2.7.0)
|
@@ -31,9 +50,12 @@ GEM
|
|
31
50
|
loofah (2.0.2)
|
32
51
|
nokogiri (>= 1.5.9)
|
33
52
|
mini_portile (0.6.2)
|
34
|
-
minitest (5.
|
53
|
+
minitest (5.8.0)
|
35
54
|
nokogiri (1.6.6.2)
|
36
55
|
mini_portile (~> 0.6.0)
|
56
|
+
rack (1.6.4)
|
57
|
+
rack-test (0.6.3)
|
58
|
+
rack (>= 1.0)
|
37
59
|
rails-deprecated_sanitizer (1.0.3)
|
38
60
|
activesupport (>= 4.2.0.alpha)
|
39
61
|
rails-dom-testing (1.0.6)
|
@@ -42,6 +64,11 @@ GEM
|
|
42
64
|
rails-deprecated_sanitizer (>= 1.0.1)
|
43
65
|
rails-html-sanitizer (1.0.2)
|
44
66
|
loofah (~> 2.0)
|
67
|
+
railties (4.2.3)
|
68
|
+
actionpack (= 4.2.3)
|
69
|
+
activesupport (= 4.2.3)
|
70
|
+
rake (>= 0.8.7)
|
71
|
+
thor (>= 0.18.1, < 2.0)
|
45
72
|
rake (10.4.2)
|
46
73
|
rspec (3.3.0)
|
47
74
|
rspec-core (~> 3.3.0)
|
@@ -55,7 +82,17 @@ GEM
|
|
55
82
|
rspec-mocks (3.3.2)
|
56
83
|
diff-lcs (>= 1.2.0, < 2.0)
|
57
84
|
rspec-support (~> 3.3.0)
|
85
|
+
rspec-rails (3.3.3)
|
86
|
+
actionpack (>= 3.0, < 4.3)
|
87
|
+
activesupport (>= 3.0, < 4.3)
|
88
|
+
railties (>= 3.0, < 4.3)
|
89
|
+
rspec-core (~> 3.3.0)
|
90
|
+
rspec-expectations (~> 3.3.0)
|
91
|
+
rspec-mocks (~> 3.3.0)
|
92
|
+
rspec-support (~> 3.3.0)
|
58
93
|
rspec-support (3.3.0)
|
94
|
+
sqlite3 (1.3.10)
|
95
|
+
thor (0.19.1)
|
59
96
|
thread_safe (0.3.5)
|
60
97
|
tzinfo (1.2.2)
|
61
98
|
thread_safe (~> 0.1)
|
@@ -66,9 +103,12 @@ PLATFORMS
|
|
66
103
|
DEPENDENCIES
|
67
104
|
actionview
|
68
105
|
actionview-helpers-auto_tag_helper
|
106
|
+
activerecord-mlang
|
69
107
|
bundler (~> 1.10)
|
70
108
|
rake (~> 10.0)
|
71
109
|
rspec
|
110
|
+
rspec-rails
|
111
|
+
sqlite3
|
72
112
|
we_bridge-auto_view_helper!
|
73
113
|
|
74
114
|
BUNDLED WITH
|
@@ -64,7 +64,8 @@ module WeBridge
|
|
64
64
|
flash[:notice]='Record was successfully updated.'
|
65
65
|
redirect_to action: :show, id: @record.id
|
66
66
|
end
|
67
|
-
rescue
|
67
|
+
rescue => e
|
68
|
+
flash[:error]=e.message + e.backtrace.join("\n")
|
68
69
|
redirect_to action: :edit, id: @record.id
|
69
70
|
end
|
70
71
|
|
@@ -83,12 +84,17 @@ module WeBridge
|
|
83
84
|
|
84
85
|
# Only allow a trusted parameter "white list" through.
|
85
86
|
def record_params
|
86
|
-
|
87
|
+
column_names = self.class.model.try(:editable_columns) || self.class.model.content_columns.map(&:name)
|
88
|
+
params.require(self.class.model.table_name).permit(*column_names)
|
87
89
|
end
|
88
90
|
|
89
91
|
def record_text_params
|
90
|
-
|
91
|
-
|
92
|
+
if !(text = self.class.model.try(:text))
|
93
|
+
return nil
|
94
|
+
end
|
95
|
+
columns = text.try(:editable_columns) || text.content_columns.map(&:name)
|
96
|
+
lang_model = ( defined?(Lang) ? Lang : ActiveRecord::Mlang::Lang )
|
97
|
+
permit = Hash[*lang_model.all.pluck(:code).map{|code| [code,columns] }.flatten(1)]
|
92
98
|
params[self.class.model.text.table_name].try(:permit,permit)
|
93
99
|
end
|
94
100
|
|
@@ -34,4 +34,6 @@ Gem::Specification.new do |spec|
|
|
34
34
|
spec.add_development_dependency "bundler", "~> 1.10"
|
35
35
|
spec.add_development_dependency "rake", "~> 10.0"
|
36
36
|
spec.add_development_dependency "rspec"
|
37
|
+
spec.add_development_dependency "rspec-rails"
|
38
|
+
spec.add_development_dependency "sqlite3"
|
37
39
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: we_bridge-auto_view_helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shinjiro Itagaki
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionview
|
@@ -94,6 +94,34 @@ dependencies:
|
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rspec-rails
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: sqlite3
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
97
125
|
description: helper used in we-bridge
|
98
126
|
email:
|
99
127
|
- ishinjiroster@gmail.com
|