Updating resources
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
class Resource < ActiveRecord::Base
|
||||
belongs_to :owner, :class_name => "ToolshareUser"
|
||||
belongs_to :owner, :class_name => "ToolshareUser" #TODO: remove owner
|
||||
belongs_to :user
|
||||
belongs_to :category, :class_name => "ResourceCategory"
|
||||
has_attached_file :picture,
|
||||
has_attached_file :picture, #TODO: move to local storage
|
||||
:styles => { :medium => "300x300>",
|
||||
:thumb => "100x100>",
|
||||
:tiny => "50x50>"},
|
||||
@@ -9,4 +10,8 @@ class Resource < ActiveRecord::Base
|
||||
:s3_credentials => Rails.root.join('config', 's3.yml'),
|
||||
:path => ":attachment/:id/:style.:extension",
|
||||
:bucket => 'Toolshare'
|
||||
|
||||
def category_name
|
||||
self.category.name if self.category
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user