开发者

can rename column size to filesize cause problem in attachment_fu?

开发者 https://www.devze.com 2023-01-19 00:37 出处:网络
can I rename the columns with attachment_fu开发者_开发百科 ? I am using oracle as my database and size is keyword in oracle. so i don\'t want to create a column with size name. So is it ok to create

can I rename the columns with attachment_fu开发者_开发百科 ?

I am using oracle as my database and size is keyword in oracle. so i don't want to create a column with size name. So is it ok to create a column with filesize instead of size while using attachment_fu ??


If you are using filesize, just add the following method to the class having the attachment.

  def size 
    self.filesize 
  end

  def size=(bytes) 
    self.filesize = bytes 
  end

which should solve your problem , without hacking into attachment_fu.

0

精彩评论

暂无评论...
验证码 换一张
取 消