public
Description: StrokeDB is an embeddable distributed document database written in Ruby
Homepage: http://strokedb.com/
Clone URL: git://github.com/yrashk/strokedb.git
better naming schema for association views [#25 state:resolved]
yrashk (author)
Tue Apr 29 11:22:26 -0700 2008
commit  07d858a8aa8c90771089dfa21abe0f2ac6fbc4a7
tree    f179cd8331b7c1dcba7f76631047ace04f3e073a
parent  f58c76c4d40a697e66ad63c4b52e09da22fbd3c0
...
91
92
93
94
95
 
96
97
98
...
91
92
93
 
 
94
95
96
97
0
@@ -91,8 +91,7 @@ module StrokeDB
0
         #   meta = _t.join('::') 
0
         # end
0
         
0
-        
0
-        view = View.define!({ :reference_slotname => reference_slotname, :through => through, :expected_meta => meta, :extend_with => extend_with }.to_json,
0
+        view = View.define!("#{name.modulize.empty? ? Module.nsurl : name.modulize.constantize.nsurl}##{name.demodulize.tableize.singularize}_has_many_#{slotname}",
0
                             { :reference_slotname => reference_slotname, :through => through, :expected_meta => meta, :extend_with => extend_with }, &AssociationViewImplementation)
0
         
0
         @args.last.reverse_merge!({"has_many_#{slotname}" => view})

Comments