brief 1.6.0 → 1.6.1

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: 9a7fdb09f6012e32e84d8dbd2389b556d43e2ebd
4
- data.tar.gz: 2ac225ed8670e6eba082bac6e548b931bd9d8666
3
+ metadata.gz: e40ba8497cd64fef959861d1349e7a955bbf0df7
4
+ data.tar.gz: 596ab5f961548a7ff2088d87bc0e4e68c3ef1b47
5
5
  SHA512:
6
- metadata.gz: bbad8b3c8b85ea4fe27bb4f56063f7f24f0ce977d7a247b80d719c4d443660ba7ee3cd20dd46f51cde66f4b71eb08401f22c9187fd461f5b6e21248bd3649d61
7
- data.tar.gz: 458f15c26bc5c647a7024c9f339cb63d574a98a836a984241ff14de831e6c35cf70e76c77d5f4d4ae3c6285314e36cff6374332474fd556dd62a6c11ead700e7
6
+ metadata.gz: 263dfac1ba20242d8aae3c3fa7d2876bef767141c7d05f66723ac068d10efb3e8b1c5e8fb4f06bc10e4dfd5bc85363d3ef02b6e5b78a3ae98b8163a3460d7737
7
+ data.tar.gz: cf69dca6f61a98015ee53b8bc54dc64f32160b4533aa89d2200081bb38dd01cfb94e3fab0ee4097122ba0f6737fdd0b3352edb3b564d73421c6ec86fa657fa40
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- brief (1.5.2)
4
+ brief (1.6.0)
5
5
  activemodel
6
6
  activesupport
7
7
  commander
@@ -124,12 +124,17 @@ module Brief
124
124
  uses_app? && app_path.join("models")
125
125
  end
126
126
 
127
- def model_class_for(document_type)
128
- return generic_model_class_for(document_type) unless uses_app?
127
+ def app_namespace
128
+ Brief::Apps.find_namespace(options[:app])
129
+ end
130
+
131
+ def app_models
132
+ app_namespace.constants.map {|c| app_namespace.const_get(c) }
133
+ end
129
134
 
130
- namespace = Brief::Apps.find_namespace(options[:app])
131
- classes = namespace.constants.map {|c| namespace.const_get(c) }
132
- classes.find {|k| k.type_alias == document_type }
135
+ def model_class_for(document)
136
+ return generic_model_class_for(document) unless uses_app?
137
+ app_models.find {|k| k.type_alias == document.document_type }
133
138
  end
134
139
 
135
140
  def generic_model_class_for(document)
data/lib/brief/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Brief
2
- VERSION = '1.6.0'
2
+ VERSION = '1.6.1'
3
3
  end
@@ -2,7 +2,7 @@
2
2
  type: concept
3
3
  title: Blueprint Concept Example
4
4
  subheading: A key concept to the domain model
5
- needle: 23gzm1i9syj6zqbupef6rpcfec0595zvj5wj
5
+ needle: cbw5astzg5gh0ui3op68054s9sm39me6vjvc
6
6
  ---
7
7
 
8
- # Modified Content 2rbypt02tkt5zf3f3oiz33no1j9nzfm8pc78
8
+ # Modified Content oh5lszxtl7w8uyldpjrum1w5uy3pbr33wsh
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brief
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Soeder