carrierwave_reupload_fix 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,7 @@
1
+ # Version 0.3.0
2
+
3
+ Alias #update_attributes to #update
4
+
1
5
  # Version 0.2.0
2
6
 
3
7
  Fix bug in update action - in version 0.1.0 it always returned true
data/README.md CHANGED
@@ -115,10 +115,7 @@ DummyModel.find(id).update(some_attributes)
115
115
 
116
116
  Restart your application and enjoy.
117
117
 
118
- Works with Rails 4. If you are using Rails 3, you should alias update_attributes to update:
119
-
120
- ```ruby
121
- alias :update :update_attributes
118
+ Works also with #update_attributes method.
122
119
  ```
123
120
 
124
121
  ## Contributing
@@ -48,5 +48,8 @@ module CarrierwaveReuploadFix
48
48
  false
49
49
  end
50
50
  end
51
+
52
+ alias :update_attributes :update
53
+
51
54
  end
52
55
  end
@@ -1,3 +1,3 @@
1
1
  module CarrierwaveReuploadFix
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
@@ -56,19 +56,11 @@ describe CarrierwaveReuploadFix do
56
56
  expect(DummyMainModel.new).to respond_to :update
57
57
  end
58
58
 
59
- context "#update" do
59
+ describe "#update" do
60
60
 
61
61
  it "calls fixer on update if update returns true and the entire" do
62
62
  model_instance = DummyMainModel.new
63
- model_instance.stub(:original_update) { true }
64
- fixer = double(:fixer)
65
- recreator = double(:recreator)
66
- assigner = double(:assigner)
67
- CarrierwaveReuploadFix::VersionsRecreator.stub(:new) { recreator }
68
- CarrierwaveReuploadFix::ExtensionsAssigner.stub(:new) { assigner }
69
- CarrierwaveReuploadFix::ReuploadFixer.should_receive(:new).with(model_instance,
70
- recreator, assigner) { fixer }
71
- fixer.should_receive(:fix)
63
+ perform_update(model_instance)
72
64
  model_instance.update({})
73
65
  end
74
66
 
@@ -95,5 +87,27 @@ describe CarrierwaveReuploadFix do
95
87
  end
96
88
  end
97
89
 
90
+ describe "#update_attributes" do
91
+
92
+ it "works as #update" do
93
+ model_instance = DummyMainModel.new
94
+ perform_update(model_instance)
95
+ model_instance.update_attributes({})
96
+ end
97
+
98
+ end
99
+
100
+ end
101
+
102
+ def perform_update(model_instance)
103
+ model_instance.stub(:original_update) { true }
104
+ fixer = double(:fixer)
105
+ recreator = double(:recreator)
106
+ assigner = double(:assigner)
107
+ CarrierwaveReuploadFix::VersionsRecreator.stub(:new) { recreator }
108
+ CarrierwaveReuploadFix::ExtensionsAssigner.stub(:new) { assigner }
109
+ CarrierwaveReuploadFix::ReuploadFixer.should_receive(:new).with(model_instance,
110
+ recreator, assigner) { fixer }
111
+ fixer.should_receive(:fix)
98
112
  end
99
113
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carrierwave_reupload_fix
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-08-06 00:00:00.000000000 Z
12
+ date: 2013-12-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler