inline_forms_installer 8.1.59 → 8.1.61

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9a8fb98ca32062518006ec1a4f24690cc6e4f8a55c313ca47634e378ee689e0b
4
- data.tar.gz: 63b4e47b930c8e49f99bef7973f92198508cb51d127d792902d3d63e5559ccce
3
+ metadata.gz: 8c6f069c96fd0e7598a438f56447b8205baf15a35dd1a6bab0326df74e831bdf
4
+ data.tar.gz: 9d289beb55c1ac15cd1ecd969f86962995f90dc7a4829965b5971e5454cc309e
5
5
  SHA512:
6
- metadata.gz: e57494b801e1a3f13b78be90ba7d76d5346fefe4ac14d01a2bd1b4a4e1cd62b745f7486fd34d5a5df3563b24ec5a389eb1149b4366b08f968754c1476cd28381
7
- data.tar.gz: bf33012b7318a8f7aceea64dad2c203634295826410f964144b066eba0eab815f605671e84c03c952699934cefe98b524965f0f077e86ed9d1f1d9e2761f94e2
6
+ metadata.gz: 010cf011587607315cbec7c5dd848adb6e400f2f1b78ed27c3e93f71c5a544e23bd568c07d6fdf07daa3e4204dd4786583ebd00c0938ccbaeffa3a109f2f018f
7
+ data.tar.gz: a9cc8aaa125436c16f15cd9ae0eb9af5a55c044d7c0c0524eefd61496035cf041ed0fd044b0fedb52bbf9389a5a874a0dc3c2abed07806a8bfc4e1effde979e4
@@ -1259,9 +1259,13 @@ if ENV['install_example'] == 'true'
1259
1259
  end
1260
1260
 
1261
1261
  def down
1262
+ # apartments.owner_id and apartments.phase_id have foreign keys:
1263
+ # release the apartments (seeded or not) that point at a seeded owner
1264
+ # or phase before destroying it, or destroy raises.
1262
1265
  OWNERS.each do |spec|
1263
- owner = Owner.find_by(name: spec[:name])
1264
- owner&.destroy
1266
+ owner = Owner.find_by(name: spec[:name]) or next
1267
+ Apartment.where(owner_id: owner.id).update_all(owner_id: nil)
1268
+ owner.destroy
1265
1269
  end
1266
1270
  APARTMENTS.each do |spec|
1267
1271
  apt = Apartment.find_by(name: spec[:name])
@@ -1270,7 +1274,11 @@ if ENV['install_example'] == 'true'
1270
1274
  apt.photos.destroy_all
1271
1275
  apt.destroy
1272
1276
  end
1273
- PHASES.each { |spec| Phase.find_by(name: spec[:name])&.destroy }
1277
+ PHASES.each do |spec|
1278
+ phase = Phase.find_by(name: spec[:name]) or next
1279
+ Apartment.where(phase_id: phase.id).update_all(phase_id: nil)
1280
+ phase.destroy
1281
+ end
1274
1282
  end
1275
1283
  end
1276
1284
  SEED_MIGRATION
@@ -1,7 +1,7 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
 
3
3
  module InlineFormsInstaller
4
- VERSION = "8.1.59"
4
+ VERSION = "8.1.61"
5
5
 
6
6
  # Canonical bare Ruby version (must match gemspec `required_ruby_version`).
7
7
  # Written verbatim into generated apps' `.ruby-version` for rbenv/chruby/asdf/
@@ -23,8 +23,18 @@ Rails.application.config.dartsass.builds = {
23
23
  # inline_forms_install/*_main.scss entries would resolve to the PREVIOUS OUTPUT
24
24
  # app/assets/builds/inline_forms/{inline_forms,devise}.css instead of the gem's
25
25
  # .scss: from the second build on, each build re-imports its own stale result
26
- # and gem stylesheet changes never reach the app. build_options precede the
27
- # load paths in the command, so this --load-path wins. Single token on
28
- # purpose: the runner splits every build_options entry on whitespace.
29
- Rails.application.config.dartsass.build_options <<
30
- "--load-path=#{InlineForms::Engine.root.join('app/assets/stylesheets')}"
26
+ # and gem stylesheet changes never reach the app.
27
+ #
28
+ # The gem dir goes in front of the runner's own --load-path list, as a
29
+ # separate argument: not in build_options (the runner splits every entry there
30
+ # on whitespace, which breaks a gem path with a space in it) and not first on
31
+ # config.assets.paths (Sprockets would then resolve inline_forms/*.css to the
32
+ # gem's .scss instead of the compiled build).
33
+ require "dartsass/runner"
34
+
35
+ module InlineFormsDartsassLoadPath
36
+ def dartsass_load_paths
37
+ [ "--load-path", InlineForms::Engine.root.join("app/assets/stylesheets").to_s ] + super
38
+ end
39
+ end
40
+ Dartsass::Runner.singleton_class.prepend(InlineFormsDartsassLoadPath)
@@ -17,7 +17,8 @@ class ExampleAppDartsassBuildTest < ActiveSupport::TestCase
17
17
  command = Dartsass::Runner.dartsass_compile_command
18
18
  first_load_path = command.index { |arg| arg == "--load-path" || arg.start_with?("--load-path=") }
19
19
 
20
- assert_equal "--load-path=#{gem_stylesheets}", command[first_load_path]
20
+ # Two arguments, so a gem path with a space stays one argument.
21
+ assert_equal [ "--load-path", gem_stylesheets ], command[first_load_path, 2]
21
22
  end
22
23
 
23
24
  %w[inline_forms devise].each do |entry|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inline_forms_installer
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.1.59
4
+ version: 8.1.61
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ace Suares