mumuki-domain 6.1.4 → 6.1.5

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: bb99fbaf15499ef0b00d1767fa05b708ad0c216c
4
- data.tar.gz: a71ee03b993434f5a2e95d64036868aca0f06270
3
+ metadata.gz: cc25c9836058c10703a5f9a3479642ea20132c54
4
+ data.tar.gz: 5586e6c506b9d28f27a866542cf91bea5e5a4aca
5
5
  SHA512:
6
- metadata.gz: 522983d0523374e99da3cf410ff620cc3f6c570a7b7487d1ace5e4467c46f7144a34da2d4ecdf962cfbf1e394c1984ecdc9f37a3b3de2a44682a53a9989bfdd0
7
- data.tar.gz: 11ab111e86471b8b777d8e0736fe5decf56102a612fcf13986c465e6dc8bae92f421d00c03e601b22c6aab2a7733ec7e9b81a95347713df160de3c9f59e3bc37
6
+ metadata.gz: dbe65fff7b93368ebfe18e4db33f585a21cbd886bc68d720bb5d54fd909636a5f2c01ce1b914bc4becd61bef75b4ca0d1d59cd7125f82da600979abab01c0fc2
7
+ data.tar.gz: cb02d111698a9af4766a8bba94d9e3c0f3b42ffbebb7a6ae1fb59c56a0edcb729e7f2b17eedc635636af2bccd85f2c3aed72541c156d1d11581a0fe8ba3399ae
@@ -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.1.4'
3
+ VERSION = '6.1.5'
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.1.4
4
+ version: 6.1.5
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-24 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