没有任何数据可供显示
开源项目社区 | 当前位置 : |
|
www.trustie.net/open_source_projects | 主页 > 开源项目社区 > rails-has-file |
rails-has-file
|
0 | 0 | 5 |
贡献者 | 讨论 | 代码提交 |
Rails Plugin: has_file v0.1
Website: http://code.google.com/p/rails-has-file Author: John Wulff Copyright: Copyright (c) 2007 John Wulff License: MIT
SETUP class Node < ActiveRecord::Base
has_file :donkey
endBEHAVIOUR >> n = Node.new
=> #nil}, @new_record=true>
>> n.donkey = 'secret donkey message'
=> 'secret donkey message'
>> n.donkey_file_path
=> '/tmp/node-20123394-donkey'
>> n.donkey
=> 'secret donkey message'
>> n.save!
=> true
>> n.donkey_file_path
=> '/Users/jwulff/Development/rails/resources/node-4-donkey'
>> n.donkey
=> 'secret donkey message'
>> n.destroy
=> #'2007-05-08 15:07:47'}>
>> File.exists? '/Users/jwulff/Development/rails/resources/node-4-donkey'
=> false