Permalink
Browse files

Added create alias

  • Loading branch information...
dim committed Jan 31, 2012
1 parent e16f382 commit 97a1cd36b117212f99b7358203ed0ab9339a4e69
Showing with 6 additions and 0 deletions.
  1. +2 −0 lib/redpear/model.rb
  2. +4 −0 spec/redpear/model_spec.rb
View
@@ -30,6 +30,8 @@ class Redpear::Model < Hash
class << self
+ alias_method :create, :new
+
# @param [Redpear::Connection] define a custom connection
attr_writer :connection
@@ -35,6 +35,10 @@
subject.pk_counter.next.should == 1
end
+ it 'should have a create alias for new' do
+ subject.create.should be_instance_of(subject)
+ end
+
it 'should have a scope' do
subject.scope.should == "posts"
end

0 comments on commit 97a1cd3

Please sign in to comment.