mumuki-domain 6.0.3 → 6.0.4

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: 0fad2ecd67525418ebd21e6b6b7bb9e190aa0221
4
- data.tar.gz: afb33d70f417502e0077083012e9ad6eb0cbb4b8
3
+ metadata.gz: ed9e82dd56783101526c2b4dcd7366d5a4ab2a9f
4
+ data.tar.gz: a1a3a1838c41c06aa54502563cf87be6a2713f9b
5
5
  SHA512:
6
- metadata.gz: e050c244b1937af8a0b78c18e0a69b0d2cf324b32bef213ea5dd0bd83cc657182605791e7927d43fc1f9ac6813b29915ed9cba2c2e15964bebf4bbe734223e53
7
- data.tar.gz: 96c5eab7647489c35cc5b8d4e4f7d52b52a65c43aada24def22cc51477790147d997dcf0d55fa0a1af26c8b0c6f223fb4997488547f64df431ee70ebe47c2294
6
+ metadata.gz: 8ffaf2b407569be9c41a7535b9b9d66903d20c4a5c8e51a151d5438db7c3f74935942de081df520706872cb9b83cfd169f234d6abf3fe8dbdaa5beeaae3b6613
7
+ data.tar.gz: 69295d1103a34b7914f0cdd3d7538f7b1b6594b667f510f83c36dcc71e4badefa475c9bba083e8b2322834c5d4508535e760a1567d06ff33526f9f64cba28142
@@ -96,6 +96,16 @@ class Organization < ApplicationRecord
96
96
  report_issue_enabled? || community_link.present? || forum_enabled?
97
97
  end
98
98
 
99
+ def self.import_from_resource_h!(resource_h)
100
+ find_or_initialize_by(name: resource_h[:name]).tap { |it| it.import_from_resource_h! resource_h }
101
+ end
102
+
103
+ def import_from_resource_h!(resource_h)
104
+ attrs = Mumukit::Platform::Organization::Helpers.slice_platform_json resource_h
105
+ attrs[:book] = Book.locate_resource attrs[:book]
106
+ update! attrs
107
+ end
108
+
99
109
  private
100
110
 
101
111
  def ensure_consistent_public_login
@@ -1,5 +1,5 @@
1
1
  module Mumuki
2
2
  module Domain
3
- VERSION = '6.0.3'
3
+ VERSION = '6.0.4'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mumuki-domain
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.3
4
+ version: 6.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franco Leonardo Bulgarelli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-22 00:00:00.000000000 Z
11
+ date: 2018-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails