Skip to content

Commit

Permalink
Fix spec that had old code
Browse files Browse the repository at this point in the history
  • Loading branch information
paulcsmith committed May 25, 2018
1 parent 7872ac2 commit ec32313
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
6 changes: 3 additions & 3 deletions spec/type_extension_spec.cr
Expand Up @@ -14,12 +14,12 @@ end

describe "TypeExtensions" do
it "should work in boxes" do
CompanyBox.save
CompanyBox.create
company = CompanyQuery.new.first
company.sales.should eq Int64::MAX
company.earnings.should eq 1.0

company2 = CompanyBox.new.sales(10_i64).earnings(2.0).save
company2 = CompanyBox.create &.sales(10_i64).earnings(2.0)
company2.sales.should eq 10_i64
company2.earnings.should eq 2.0
end
Expand All @@ -31,7 +31,7 @@ describe "TypeExtensions" do
end

it "Int64 and Float64 should allow querying with Int32" do
CompanyBox.new.sales(10_i64).earnings(1.0).save
CompanyBox.create &.sales(10_i64).earnings(1.0)
using_sales = CompanyQuery.new.sales(10).first
using_sales.sales.should eq 10_i64

Expand Down
4 changes: 0 additions & 4 deletions src/lucky_record/box.cr
Expand Up @@ -12,10 +12,6 @@ abstract class LuckyRecord::Box
self
end

def save
self.class.save
end

def self.save
{% raise "'Box.save' has been renamed to 'Box.create' to match 'Form.create'" %}
end
Expand Down

0 comments on commit ec32313

Please sign in to comment.