mumukit-platform 2.5.0 → 2.6.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 347b67e0af757d17cff23a45abeab42998e75426ec534c8d438683ad22736572
|
4
|
+
data.tar.gz: 199bed2e1f9e605540fc175011dbab337f7c3b2b4a40e6f32c0e41632447bde1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc386f8404e7f9b897f9b971531f564b0ff0ef375ba37e1f70b94609c2f1ae8bac3af6acb99e86eddeb7a8f0e4c881d7e6caad43abb387f1c02f43cf85074d8f
|
7
|
+
data.tar.gz: 82ce465f240cbac941b8d439b30869e4019e20805fc8c38d0ae58b664abfa502d562ee44057a2c9394119ce56e3099a7681f98380c81e0e8e27c935f1b1d1b64
|
@@ -3,25 +3,41 @@ require 'active_model'
|
|
3
3
|
class Mumukit::Platform::Model
|
4
4
|
include ActiveModel::Model
|
5
5
|
|
6
|
+
class_attribute :readers, :attributes
|
7
|
+
|
8
|
+
self.readers = []
|
9
|
+
self.attributes = []
|
10
|
+
|
6
11
|
def empty?
|
7
12
|
as_json.empty?
|
8
13
|
end
|
9
14
|
|
10
15
|
## Accessors
|
11
16
|
|
12
|
-
def self.model_attr_accessor(*
|
13
|
-
bools, raws =
|
17
|
+
def self.model_attr_accessor(*readers)
|
18
|
+
bools, raws = readers.partition { |it| it.to_s.end_with? '?' }
|
14
19
|
raw_bools = bools.map { |it| it.to_s[0..-2].to_sym }
|
15
|
-
|
20
|
+
attributes = raws + raw_bools
|
21
|
+
|
22
|
+
self.readers += readers
|
23
|
+
self.attributes += raws + raw_bools
|
24
|
+
|
25
|
+
define_attr_readers attributes, raw_bools
|
26
|
+
define_attr_writers raws, raw_bools
|
27
|
+
end
|
28
|
+
|
29
|
+
# Parses model from an event.
|
30
|
+
# Only allowed attributes are accepted
|
31
|
+
def self.parse(hash)
|
32
|
+
hash ? new(hash.slice(*self.attributes)) : new
|
33
|
+
end
|
16
34
|
|
17
|
-
|
18
|
-
|
35
|
+
def as_json(options = {})
|
36
|
+
super(options).slice(*self.class.attributes.map(&:to_s))
|
37
|
+
end
|
19
38
|
|
20
|
-
|
21
|
-
|
22
|
-
define_singleton_method :parse do |hash|
|
23
|
-
hash ? new(hash.slice(*keys)) : new
|
24
|
-
end
|
39
|
+
def self.accessors
|
40
|
+
self.readers + self.attributes.map { |it| "#{it}=".to_sym }
|
25
41
|
end
|
26
42
|
|
27
43
|
# Define the attribute readers for the model,
|
@@ -11,58 +11,9 @@ module Mumukit::Platform::Organization::Helpers
|
|
11
11
|
# * theme
|
12
12
|
|
13
13
|
included do
|
14
|
-
delegate :
|
15
|
-
|
16
|
-
|
17
|
-
:extension_javascript=, to: :theme
|
18
|
-
|
19
|
-
delegate :login_methods,
|
20
|
-
:login_methods=,
|
21
|
-
:login_provider,
|
22
|
-
:login_provider=,
|
23
|
-
:provider_settings,
|
24
|
-
:provider_settings=,
|
25
|
-
:login_settings,
|
26
|
-
:feedback_suggestions_enabled?,
|
27
|
-
:feedback_suggestions_enabled=,
|
28
|
-
:raise_hand_enabled?,
|
29
|
-
:raise_hand_enabled=,
|
30
|
-
:forum_enabled?,
|
31
|
-
:forum_enabled=,
|
32
|
-
:report_issue_enabled?,
|
33
|
-
:report_issue_enabled=,
|
34
|
-
:public?,
|
35
|
-
:public=,
|
36
|
-
:embeddable?,
|
37
|
-
:embeddable=,
|
38
|
-
:immersive?,
|
39
|
-
:immersive=,
|
40
|
-
:private?, to: :settings
|
41
|
-
|
42
|
-
delegate :logo_url,
|
43
|
-
:logo_url=,
|
44
|
-
:banner_url,
|
45
|
-
:banner_url=,
|
46
|
-
:open_graph_image_url,
|
47
|
-
:open_graph_image_url=,
|
48
|
-
:favicon_url,
|
49
|
-
:favicon_url=,
|
50
|
-
:breadcrumb_image_url,
|
51
|
-
:breadcrumb_image_url=,
|
52
|
-
:locale,
|
53
|
-
:locale=,
|
54
|
-
:locale_json,
|
55
|
-
:description,
|
56
|
-
:description=,
|
57
|
-
:community_link,
|
58
|
-
:community_link=,
|
59
|
-
:terms_of_service,
|
60
|
-
:terms_of_service=,
|
61
|
-
:contact_email,
|
62
|
-
:contact_email=,
|
63
|
-
:errors_explanations,
|
64
|
-
:errors_explanations=, to: :profile
|
65
|
-
|
14
|
+
delegate *Mumukit::Platform::Organization::Theme.accessors, to: :theme
|
15
|
+
delegate *Mumukit::Platform::Organization::Settings.accessors, :private?, :login_settings, to: :settings
|
16
|
+
delegate *Mumukit::Platform::Organization::Profile.accessors, :locale_json, to: :profile
|
66
17
|
end
|
67
18
|
|
68
19
|
def platform_class_name
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mumukit-platform
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Franco Leonardo Bulgarelli
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-09-
|
11
|
+
date: 2018-09-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mumukit-nuntius
|