Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added create alias

  • Loading branch information...
commit 97a1cd36b117212f99b7358203ed0ab9339a4e69 1 parent e16f382
Dimitrij Denissenko authored January 31, 2012
2  lib/redpear/model.rb
@@ -30,6 +30,8 @@ class Redpear::Model < Hash
30 30
 
31 31
   class << self
32 32
 
  33
+    alias_method :create, :new
  34
+
33 35
     # @param [Redpear::Connection] define a custom connection
34 36
     attr_writer :connection
35 37
 
4  spec/redpear/model_spec.rb
@@ -35,6 +35,10 @@
35 35
       subject.pk_counter.next.should == 1
36 36
     end
37 37
 
  38
+    it 'should have a create alias for new' do
  39
+      subject.create.should be_instance_of(subject)
  40
+    end
  41
+
38 42
     it 'should have a scope' do
39 43
       subject.scope.should == "posts"
40 44
     end

0 notes on commit 97a1cd3

Please sign in to comment.
Something went wrong with that request. Please try again.