• R/O
  • SSH
  • HTTPS

tenarai: 提交


Commit MetaInfo

修訂131 (tree)
時間2008-11-01 01:57:45
作者junkikuchi

Log Message

updated.

Change Summary

差異

--- trunk/webapp/Widget/Resource.rb (revision 130)
+++ trunk/webapp/Widget/Resource.rb (revision 131)
@@ -8,7 +8,7 @@
88 class Resource < ::Widget
99 extend Tenarai::ClassLoader
1010
11- property :table_name
11+ property :model
1212
1313 attr_reader :content
1414 attr_reader :model
@@ -16,26 +16,26 @@
1616 def init(builder, service, _id=nil)
1717 super(builder, service)
1818
19- if property[:table_name].nil?
20- property[:table_name] = self.class.name.split('::').pop.downcase
19+ if property[:model].nil?
20+ property[:model] = self.class.name.split('::').pop.downcase
2121 end
2222
23- @model = @service.model[property[:table_name]]
23+ @model = @service.models[property[:model]]
2424 @content = @model.fetch(_id)
2525 end
2626
27- def uri(view, *param, &block)
27+ def uri(view, *params, &block)
2828 query = Tenarai::CGI::Query.new
2929 block.call(query) if block_given?
30- build_uri(view, param, query)
30+ build_uri(view, params, query)
3131 end
3232
33- def widget_uri(path, query, param=[])
34- param = [@content.id] if param.empty? && @content
33+ def widget_uri(path, query, params=[])
34+ params = [@content.id] if params.empty? && @content
3535 if view.resource.path.include?(self)
36- path << param.join(',')
36+ path << params.join(',')
3737 else
38- query[html_id] = param.join(',')
38+ query[html_id] = params.join(',')
3939 end
4040 end
4141 end
Show on old repository browser