Skip to content

Commit 7bf1256

Browse files
committed
Fixes active model dirty modification
1 parent 83e8394 commit 7bf1256

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

Gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ group :development do
2626
gem 'rake'
2727
# gem 'debugger'
2828
gem 'quiet_assets'
29-
#gem 'better_errors'
30-
#gem 'binding_of_caller'
29+
gem 'better_errors'
30+
gem 'binding_of_caller'
3131
end
3232
group :test, :development do
3333
gem 'minitest', '~>5.3.3'

Gemfile.lock

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@ GEM
7070
autoprefixer-rails (6.7.7)
7171
execjs
7272
bcrypt (3.1.11)
73+
better_errors (2.1.1)
74+
coderay (>= 1.0.0)
75+
erubis (>= 2.6.6)
76+
rack (>= 0.9.0)
77+
binding_of_caller (0.7.2)
78+
debug_inspector (>= 0.0.1)
7379
bluecloth (2.2.0)
7480
bootstrap-sass (3.3.7)
7581
autoprefixer-rails (>= 5.2.1)
@@ -89,6 +95,7 @@ GEM
8995
climate_control (0.1.0)
9096
cocaine (0.5.8)
9197
climate_control (>= 0.0.3, < 1.0)
98+
coderay (1.1.0)
9299
compass (1.0.3)
93100
chunky_png (~> 1.2)
94101
compass-core (~> 1.0.2)
@@ -125,6 +132,7 @@ GEM
125132
cucumber-wire (0.0.1)
126133
daemons (1.1.9)
127134
database_cleaner (1.2.0)
135+
debug_inspector (0.0.2)
128136
devise (3.5.10)
129137
bcrypt (~> 3.0)
130138
orm_adapter (~> 0.1)
@@ -287,6 +295,8 @@ PLATFORMS
287295

288296
DEPENDENCIES
289297
aruba
298+
better_errors
299+
binding_of_caller
290300
bluecloth
291301
browsercms!
292302
capybara

lib/cms/behaviors/versioning.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ def build_object_from_version()
3737

3838
# Last but not least, clear the changed attributes
3939
if changed_attrs = obj.send(:changed_attributes)
40-
changed_attrs.clear
40+
if self.class.private_instance_methods.include? :clear_attribute_changes
41+
clear_attribute_changes changed_attrs
42+
else
43+
changed_attributes.clear
44+
end
4145
end
4246

4347
obj

0 commit comments

Comments
 (0)