Skip to content

Commit

Permalink
Merge branch 'master' into new-views
Browse files Browse the repository at this point in the history
* master:
  Meta#+ support modulized metas now
  • Loading branch information
Oleg Andreev committed Apr 29, 2008
2 parents 04b4120 + 7ba89cc commit ffd6043
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/strokedb/document/meta.rb
Expand Up @@ -86,9 +86,10 @@ def +(meta)
new_meta.module_eval do
extend Meta
end
new_meta_name = new_meta.instance_variable_get(:@metas).map{|m| m.name}.join('__')
Object.send(:remove_const, new_meta_name) rescue nil
Object.const_set(new_meta_name, new_meta)
new_meta_name = new_meta.instance_variable_get(:@metas).map{|m| m.name.demodulize}.join('__')
mod = self.name.modulize.constantize rescue Object
mod.send(:remove_const, new_meta_name) rescue nil
mod.const_set(new_meta_name, new_meta)
new_meta
elsif is_a?(Document) && meta.is_a?(Document)
(Document.new(store, self.to_raw.except('uuid','version','previous_version'), true) +
Expand Down

0 comments on commit ffd6043

Please sign in to comment.