naranya_ecm-sdk 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/naranya_ecm-sdk.rb +3 -2
- data/lib/naranya_ecm-sdk/version.rb +1 -1
- data/lib/naranya_ecm/models/content.rb +7 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 051efab878ede03ba71216439d6aa4985f02b2c3
|
4
|
+
data.tar.gz: c3ca3396182aa10c7fc226d171a6a7864abc8ac7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a98037ffa90b8061bc867c208d06af0ad805b3fe01502ba01234192a66ff17794bfdc0a74f2faed3a5ab97e76721d18acf30b3fc5984765df317a47dd29fe55
|
7
|
+
data.tar.gz: 47dbd509de94213649a729266e374ba3f0d1fdde04d579f2f043e7bfb8c3d8bd3fd2348a9cc2e5b250ddc4f43440a7e9c3c9f230f419f83d5406ec3f57c04c5d
|
data/lib/naranya_ecm-sdk.rb
CHANGED
@@ -33,11 +33,11 @@ module NaranyaEcm
|
|
33
33
|
class << self
|
34
34
|
|
35
35
|
def storage
|
36
|
-
@storage ||= Fog::Storage.new options[
|
36
|
+
@storage ||= Fog::Storage.new options[:storage].except(:root_directory)
|
37
37
|
end
|
38
38
|
|
39
39
|
def root_directory
|
40
|
-
@root_directory ||= storage.directories.get(options[
|
40
|
+
@root_directory ||= storage.directories.get(options[:storage][:root_directory])
|
41
41
|
end
|
42
42
|
|
43
43
|
def setup
|
@@ -56,6 +56,7 @@ module NaranyaEcm
|
|
56
56
|
def load_config_from_yml(yml_path, env="production")
|
57
57
|
raise "YAML file doesn't extst" unless File.exist?(yml_path)
|
58
58
|
yml_config = DEFAULT_CONFIG.merge(YAML::load(ERB.new(File.read(yml_path)).result)[env])
|
59
|
+
.with_indifferent_access
|
59
60
|
setup { |config| yml_config.each { |key, val| config.send "#{key}=".to_sym, val } }
|
60
61
|
end
|
61
62
|
|
@@ -40,7 +40,7 @@ module NaranyaEcm
|
|
40
40
|
schema do
|
41
41
|
# define each attribute separately
|
42
42
|
string :id, :type, :lifecycle_name, :lifecycle_state, :content_rating, :created_at, :updated_at
|
43
|
-
|
43
|
+
string :category, :category_id
|
44
44
|
string :author
|
45
45
|
string :main_url
|
46
46
|
|
@@ -75,6 +75,12 @@ module NaranyaEcm
|
|
75
75
|
|
76
76
|
delegate :title, to: :title_translations
|
77
77
|
delegate :description, to: :description_translations
|
78
|
+
|
79
|
+
def initialize(attributes = {}, persisted = false)
|
80
|
+
attributes[:title_translations] = TitleTranslations.new unless attributes[:title_translations].present?
|
81
|
+
attributes[:description_translations] = DescriptionTranslations.new unless attributes[:description_translations].present?
|
82
|
+
super
|
83
|
+
end
|
78
84
|
|
79
85
|
include NaranyaEcm::Behaviors::Timestampable
|
80
86
|
|