Skip to content

Commit 0d2fc60

Browse files
authored
Merge pull request #255 from openstax/fix/exercise-bad-attachment
Continue saving exercises even if they have invalid attachments
2 parents 3d2560f + 0c7a626 commit 0d2fc60

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

Gemfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ gem 'uglifier', '>= 1.3.0'
2626
# Use CoffeeScript for .coffee assets and views
2727
gem 'coffee-rails', '~> 4.1.0'
2828

29-
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
30-
gem 'therubyracer', platforms: :ruby
29+
gem 'mini_racer'
3130

3231
# Use jquery as the JavaScript library
3332
gem 'jquery-rails'

Gemfile.lock

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ GEM
208208
hashie
209209
transaction_isolation
210210
transaction_retry
211-
libv8 (3.16.14.19)
211+
libv8 (6.7.288.46.1)
212212
lograge (0.10.0)
213213
actionpack (>= 4)
214214
activesupport (>= 4)
@@ -227,6 +227,8 @@ GEM
227227
mini_magick (4.9.3)
228228
mini_mime (1.0.1)
229229
mini_portile2 (2.4.0)
230+
mini_racer (0.2.4)
231+
libv8 (>= 6.3)
230232
minitest (5.11.3)
231233
multi_json (1.13.1)
232234
multi_xml (0.6.0)
@@ -347,7 +349,6 @@ GEM
347349
redis-store (>= 1.2, < 2)
348350
redis-store (1.6.0)
349351
redis (>= 2.2, < 5)
350-
ref (2.0.0)
351352
remotipart (1.4.2)
352353
representable (3.0.0)
353354
declarative (~> 0.0.5)
@@ -435,9 +436,6 @@ GEM
435436
test_xml (0.1.8)
436437
diffy (~> 3.0)
437438
nokogiri (>= 1.3.2)
438-
therubyracer (0.12.3)
439-
libv8 (~> 3.16.14.15)
440-
ref
441439
thin (1.7.2)
442440
daemons (~> 1.0, >= 1.0.9)
443441
eventmachine (~> 1.0, >= 1.0.4)
@@ -517,6 +515,7 @@ DEPENDENCIES
517515
maruku
518516
mimemagic
519517
mini_magick
518+
mini_racer
520519
nifty-generators
521520
oj
522521
oj_mimic_json
@@ -549,7 +548,6 @@ DEPENDENCIES
549548
sortability
550549
squeel
551550
test_after_commit
552-
therubyracer
553551
thin
554552
timecop
555553
turbolinks

lib/has_attachments.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module ActiveRecord
33
module Base
44
def has_attachments
55
class_exec do
6-
has_many :attachments, as: :parent, dependent: :destroy, inverse_of: :parent
6+
has_many :attachments, as: :parent, dependent: :destroy, inverse_of: :parent, validate: false
77
end
88
end
99
end

0 commit comments

Comments
 (0)