Skip to content

Commit

Permalink
Fix an error caused by trying to instantiate a non-existent class
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Fulcher committed Jun 14, 2012
1 parent 56fc9a0 commit 6e148f7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions lib/vebra/helpers.rb
Expand Up @@ -112,9 +112,13 @@ def live_update!(property)
# first normalize the collection (currently nested collections)
property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|
collection.each do |file|
file[:type] = kind.to_s.singularize.camelize
file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)
file["remote_#{Vebra.models[:file][:attachment_method]}_url".to_sym] = file.delete(:url)
result << file
# if file[:type] is set, it means the attachment file class can be subclassed. In this
# case we need to ensure that the subclass exists
unless file_accessibles.include?(:type) && !defined?("#{file_class}::#{file[:type]}".constantize)
result << file
end
end

result
Expand Down
2 changes: 1 addition & 1 deletion lib/vebra/version.rb
@@ -1,3 +1,3 @@
module Vebra
VERSION = "0.2.0"
VERSION = "0.2.1"
end

0 comments on commit 6e148f7

Please sign in to comment.