Permalink
Browse files

protect from the dumb

  • Loading branch information...
1 parent 945f8df commit fa3dd4fa0175554e883dd1660630f7cf1690eaef @jackdempsey committed Dec 4, 2008
@@ -3,6 +3,7 @@ module Plugins
module Polymorphic
# Apply the plugin to the model.
def self.apply(model, options = {})
+ raise "You must pass in an options hash!" if options.blank?
plural_model = model.to_s.downcase.pluralize
singular_model = model.to_s.downcase.singularize
if as_variable = (options[:belongs_to] or options[:many_to_one])
@@ -9,4 +9,12 @@ class Blowup < Sequel::Model
end
end.should raise_error
end
+
+ it "should raise an error if you call 'is :polymorphic' without any args" do
+ lambda do
+ class Blowup < Sequel::Model
+ is :polymorphic
+ end
+ end.should raise_error
+ end
end

0 comments on commit fa3dd4f

Please sign in to comment.