contents_core 0.1.7 → 0.1.8

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
  SHA1:
3
- metadata.gz: 1f90bf12c228d2c90c68a9de55bbd802d87e7b56
4
- data.tar.gz: 0fad93688027f8dd697f81489d27f380d3787c8e
3
+ metadata.gz: 937f43e968b7279544f2587fe8bae77a9d39d625
4
+ data.tar.gz: 89a8ccab5d674f709e0ec166cfca5adc63ae76bc
5
5
  SHA512:
6
- metadata.gz: cc078d12ec01d6461b7b7c61a231c69a3d81a8bb545ec31a2db6598ea113a0cac30a54c4b48f057bcec4e5cafc4fb9a26701cf3aa617e10405084535a74048ef
7
- data.tar.gz: 7f591fdbebcd9472dfc12b6e24ae47f26f59fee7ed9e0080cd58edde97a11c8772e0b27d7741bb71d99e6eab21cd212c462c26c8151051efdb4a1b2025dcd90f
6
+ metadata.gz: bd18521b45aa4e681252146eb1dd392864cc31a7620c8b75cd8a725f3909f95bc74fc66063da304b26ab23d25b9c1f6b59d88d16a1b14c4984ed0b5f33d18d22
7
+ data.tar.gz: 31849bab25b370ac4f7fbff6c69c657b38eb629d5eeded48a4df8125aed812834748a9c8417e6b66bb52dd3c38bc1178495b4cd1be5e448c29223d3dfb35405a
@@ -182,5 +182,9 @@ module ContentsCore
182
182
  end
183
183
  end if items
184
184
  end
185
+
186
+ def self.permitted_attributes
187
+ [ :id, :name, items_attributes: [ :id ] + Item::permitted_attributes ]
188
+ end
185
189
  end
186
190
  end
@@ -28,6 +28,11 @@ module ContentsCore
28
28
  end
29
29
  end
30
30
 
31
+ def set( value )
32
+ self.data = value
33
+ self
34
+ end
35
+
31
36
  def to_s
32
37
  self.data
33
38
  end
@@ -41,9 +46,8 @@ module ContentsCore
41
46
  @@item_types ||= ContentsCore.config[:items].keys.map &:to_s
42
47
  end
43
48
 
44
- def set( value )
45
- self.data = value
46
- self
49
+ def self.permitted_attributes
50
+ [ :data_boolean, :data_datetime, :data_file, :data_float, :data_hash, :data_integer, :data_string, :data_text ]
47
51
  end
48
52
 
49
53
  protected
@@ -16,6 +16,10 @@ module ContentsCore
16
16
  self.data > 0 ? 'true' : 'false'
17
17
  end
18
18
 
19
+ def self.permitted_attributes
20
+ [ :data_boolean ]
21
+ end
22
+
19
23
  def self.type_name
20
24
  'boolean'
21
25
  end
@@ -7,6 +7,10 @@ module ContentsCore
7
7
  self
8
8
  end
9
9
 
10
+ def self.permitted_attributes
11
+ [ :data_datetime ]
12
+ end
13
+
10
14
  def self.type_name
11
15
  'datetime'
12
16
  end
@@ -20,6 +20,10 @@ module ContentsCore
20
20
  self
21
21
  end
22
22
 
23
+ def self.permitted_attributes
24
+ [ :data_file ]
25
+ end
26
+
23
27
  def self.type_name
24
28
  'file'
25
29
  end
@@ -16,6 +16,10 @@ module ContentsCore
16
16
  self.data.to_s
17
17
  end
18
18
 
19
+ def self.permitted_attributes
20
+ [ :data_float ]
21
+ end
22
+
19
23
  def self.type_name
20
24
  'float'
21
25
  end
@@ -24,6 +24,10 @@ module ContentsCore
24
24
  self.data_hash.inject( '' ) { |k, v| k + v[0] + ': ' + v[1] + "\n" }
25
25
  end
26
26
 
27
+ def self.permitted_attributes
28
+ [ :data_hash ]
29
+ end
30
+
27
31
  def self.type_name
28
32
  'hash'
29
33
  end
@@ -16,6 +16,10 @@ module ContentsCore
16
16
  self.data.to_s
17
17
  end
18
18
 
19
+ def self.permitted_attributes
20
+ [ :data_integer ]
21
+ end
22
+
19
23
  def self.type_name
20
24
  'integer'
21
25
  end
@@ -22,6 +22,10 @@ module ContentsCore
22
22
  self.save
23
23
  end
24
24
 
25
+ def self.permitted_attributes
26
+ [ :data_string ]
27
+ end
28
+
25
29
  def self.type_name
26
30
  'string'
27
31
  end
@@ -12,6 +12,10 @@ module ContentsCore
12
12
  self.save
13
13
  end
14
14
 
15
+ def self.permitted_attributes
16
+ [ :data_text ]
17
+ end
18
+
15
19
  def self.type_name
16
20
  'text'
17
21
  end
@@ -1,3 +1,3 @@
1
1
  module ContentsCore
2
- VERSION = '0.1.7'
2
+ VERSION = '0.1.8'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contents_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mat
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-12 00:00:00.000000000 Z
11
+ date: 2017-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -85,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
85
85
  version: '0'
86
86
  requirements: []
87
87
  rubyforge_project:
88
- rubygems_version: 2.4.8
88
+ rubygems_version: 2.5.2
89
89
  signing_key:
90
90
  specification_version: 4
91
91
  summary: Flexible contents structure for Rails