active_snapshot 0.3.0 → 0.3.1

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.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +10 -4
  3. data/README.md +1 -1
  4. data/Rakefile +1 -36
  5. data/lib/active_snapshot/models/snapshot.rb +1 -1
  6. data/lib/active_snapshot/models/snapshot_item.rb +1 -1
  7. data/lib/active_snapshot/version.rb +1 -1
  8. data/lib/active_snapshot.rb +20 -17
  9. metadata +4 -84
  10. data/test/dummy_app/Rakefile +0 -7
  11. data/test/dummy_app/app/assets/config/manifest.js +0 -3
  12. data/test/dummy_app/app/assets/javascripts/application.js +0 -0
  13. data/test/dummy_app/app/assets/stylesheets/application.css +0 -3
  14. data/test/dummy_app/app/controllers/application_controller.rb +0 -3
  15. data/test/dummy_app/app/models/application_record.rb +0 -3
  16. data/test/dummy_app/app/models/comment.rb +0 -5
  17. data/test/dummy_app/app/models/note.rb +0 -5
  18. data/test/dummy_app/app/models/parent_without_children.rb +0 -5
  19. data/test/dummy_app/app/models/post.rb +0 -16
  20. data/test/dummy_app/app/models/sub_post.rb +0 -11
  21. data/test/dummy_app/app/models/volatile_post.rb +0 -5
  22. data/test/dummy_app/app/views/layouts/application.html.erb +0 -14
  23. data/test/dummy_app/config/application.rb +0 -50
  24. data/test/dummy_app/config/boot.rb +0 -10
  25. data/test/dummy_app/config/database.yml +0 -20
  26. data/test/dummy_app/config/environment.rb +0 -5
  27. data/test/dummy_app/config/environments/test.rb +0 -41
  28. data/test/dummy_app/config/initializers/backtrace_silencers.rb +0 -7
  29. data/test/dummy_app/config/initializers/inflections.rb +0 -10
  30. data/test/dummy_app/config/initializers/mime_types.rb +0 -5
  31. data/test/dummy_app/config/initializers/secret_token.rb +0 -11
  32. data/test/dummy_app/config/initializers/session_store.rb +0 -8
  33. data/test/dummy_app/config/initializers/wrap_parameters.rb +0 -14
  34. data/test/dummy_app/config/locales/en.yml +0 -5
  35. data/test/dummy_app/config/routes.rb +0 -6
  36. data/test/dummy_app/config/secrets.yml +0 -22
  37. data/test/dummy_app/config.ru +0 -4
  38. data/test/dummy_app/db/migrate/20210128155312_set_up_test_tables.rb +0 -27
  39. data/test/dummy_app/db/migrate/20210306100122_create_snapshots_tables.rb +0 -33
  40. data/test/dummy_app/db/test.sqlite3 +0 -0
  41. data/test/dummy_app/log/test.log +0 -37780
  42. data/test/generators/active_snapshot/install_generator_test.rb +0 -31
  43. data/test/models/snapshot_item_test.rb +0 -75
  44. data/test/models/snapshot_test.rb +0 -148
  45. data/test/models/snapshots_concern_test.rb +0 -143
  46. data/test/test_helper.rb +0 -95
  47. data/test/unit/active_snapshot_test.rb +0 -57
  48. data/test/unit/config_test.rb +0 -66
  49. data/test/unit/errors_test.rb +0 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 89b0b688c46d6f42572e718276d0bb406beedf4aa3fcca78329ebd598d7a53f2
4
- data.tar.gz: 210d3f36e4a8c12d4e85665e6d0324a0054333771ab0d7cb6b104f28be7b5b46
3
+ metadata.gz: ae65e9cfd6d45c8c60d4766bf54e54c9c79692dde454a99c0b6eb4acc67878f7
4
+ data.tar.gz: aae883536807c9f8469c6b19792e509299538c942f985d8e1dbdf7afbf45e012
5
5
  SHA512:
6
- metadata.gz: 4ff8613e2c3eaf100e8234b7da297ffc82d47cc387c3b7d22511f947b6e934382261751fb8c8518f5c06e8274341432416b9bcd42e9ab07b513717de9bfa5116
7
- data.tar.gz: a9d43b41f96ace17d9a9320bbe231dabc326effc049ea1d82f44cc0cae920a61aeecc0d6a43c412e1680740a944bee56a253bdd0b8cf7b2770ea24fa71da0fde
6
+ metadata.gz: 62e07d7c2d1168428b7e043a988a86eb4ab1602654a751cad9d6892b53d2d76ffa68f873c9184441d5c0fa9188395876047af17cce1aea76322f8fe8e1b65135
7
+ data.tar.gz: 0ed2fd20a0c5f183e398108923a168ad57bc467142962875e3257336dfbb432f3e8097136f39c6d54cc01b4ae42967d91f075f50b3b8cba8af57c30f77d89d60
data/CHANGELOG.md CHANGED
@@ -2,8 +2,14 @@ CHANGELOG
2
2
  ---------
3
3
 
4
4
  - **Unreleased**
5
- * [View Diff](https://github.com/westonganger/active_snapshot/compare/v0.3.0...master)
6
- - Nothing yet
5
+ * [View Diff](https://github.com/westonganger/active_snapshot/compare/v0.3.1...master)
6
+ * Nothing yet
7
+
8
+ - **v0.3.1** - August 4, 2023
9
+ * [View Diff](https://github.com/westonganger/active_snapshot/compare/v0.3.0...v0.3.1)
10
+ * [#36](https://github.com/westonganger/active_snapshot/pull/36) - Allow ActiveRecord to be lazy loaded using `ActiveSupport.on_load`
11
+ * [#35](https://github.com/westonganger/active_snapshot/pull/35) - Add `optional: true` to the Snapshot `belongs_to :user` relationship
12
+ * [#39](https://github.com/westonganger/active_snapshot/pull/39) - Remove redundant validation on SnapshotItem for item_type
7
13
 
8
14
  - **v0.3.0** - November 14, 2022
9
15
  * [View Diff](https://github.com/westonganger/active_snapshot/compare/v0.2.4...v0.3.0)
@@ -11,7 +17,7 @@ CHANGELOG
11
17
  * [PR #29](https://github.com/westonganger/active_snapshot/pull/29) - Deprecate :identifier argument as a positional argument
12
18
  * [PR #30](https://github.com/westonganger/active_snapshot/pull/30) - Make snapshot identifier optional
13
19
  * [PR #32](https://github.com/westonganger/active_snapshot/pull/26) - Add configuration option `ActiveSnapshot.config.storage_method = 'serialized_json'` with support for `serialized_json`, `serialized_yaml`, `native_json`
14
- * [PR #32](https://github.com/westonganger/active_snapshot/pull/32) - Change default storage method from `serialized_yaml` to `serialized_json`.
20
+ * [PR #32](https://github.com/westonganger/active_snapshot/pull/32) - Change default storage method from `serialized_yaml` to `serialized_json`.
15
21
  * [PR #32](https://github.com/westonganger/active_snapshot/pull/32) - `snapshot.metadata` and `snapshot_item.object` no longer return a HashWithIndifferentAccess. Now they simply return a regular Hash.
16
22
  * **Upgrade Instructions**
17
23
  * Change all instances of `create_snapshot!("my-snapshot-1"` to `create_snapshot!(identifier: "my-snapshot-1"`
@@ -46,7 +52,7 @@ CHANGELOG
46
52
  * Fix test suite
47
53
  * [View Diff](https://github.com/westonganger/active_snapshot/compare/v0.1.0...v0.1.1)
48
54
  * Nothing yet
49
-
55
+
50
56
  - **v0.1.0** - Mar 5, 2021
51
57
  * [View Diff](https://github.com/westonganger/active_snapshot/compare/edbbfd3...v0.1.0)
52
58
  * Gem Initial Release
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  <a href="https://badge.fury.io/rb/active_snapshot" target="_blank"><img height="21" style='border:0px;height:21px;' border='0' src="https://badge.fury.io/rb/active_snapshot.svg" alt="Gem Version"></a>
4
4
  <a href='https://github.com/westonganger/active_snapshot/actions' target='_blank'><img src="https://github.com/westonganger/active_snapshot/workflows/Tests/badge.svg" style="max-width:100%;" height='21' style='border:0px;height:21px;' border='0' alt="CI Status"></a>
5
- <a href='https://rubygems.org/gems/active_snapshot' target='_blank'><img height='21' style='border:0px;height:21px;' src='https://ruby-gem-downloads-badge.herokuapp.com/active_snapshot?label=rubygems&type=total&total_label=downloads&color=brightgreen' border='0' alt='RubyGems Downloads' /></a>
5
+ <a href='https://rubygems.org/gems/active_snapshot' target='_blank'><img height='21' style='border:0px;height:21px;' src='https://img.shields.io/gem/dt/active_snapshot?color=brightgreen&label=Rubygems%20Downloads' border='0' alt='RubyGems Downloads' /></a>
6
6
 
7
7
  Simplified snapshots and restoration for ActiveRecord models and associations with a transparent white-box implementation.
8
8
 
data/Rakefile CHANGED
@@ -9,45 +9,10 @@ Rake::TestTask.new(:test) do |t|
9
9
  t.test_files = FileList["test/**/*_test.rb"]
10
10
  end
11
11
 
12
- task :db_prepare do
13
- # if ENV['CI'] != "true"
14
- # begin
15
- # require 'pg'
16
-
17
- # ### FOR LOCAL TESTING
18
- # `dropdb active_snapshot_test && createdb active_snapshot_test` rescue true
19
- # rescue LoadError
20
- # # Do nothing
21
- # end
22
- # end
23
-
24
- ### RUN GENERATOR
25
- # Dir.chdir("test/dummy_app") do
26
- # ### Instantiates Rails
27
- # require File.expand_path("test/dummy_app/config/environment.rb", __dir__)
28
-
29
- # migration_path = "db/migrate"
30
-
31
- # ### Generate Migration
32
- # require "generators/active_snapshot/install/install_generator"
33
-
34
- # generator = ActiveSnapshot::InstallGenerator.new
35
-
36
- # Dir.glob(Rails.root.join(migration_path, "*#{generator.class::MIGRATION_NAME}.rb")).each do |f|
37
- # FileUtils.rm(f)
38
- # end
39
-
40
- # generator.create_migration_file
41
- # end ### END chdir
42
- end
43
-
44
- #task default: [:db_prepare, :test]
45
12
  task default: [:test]
46
13
 
47
14
  task :console do
48
- require 'active_snapshot'
49
-
50
- require_relative 'test/dummy_app/app/models/post'
15
+ require_relative 'test/test_helper'
51
16
 
52
17
  require 'irb'
53
18
  binding.irb
@@ -6,7 +6,7 @@ module ActiveSnapshot
6
6
  attr_accessible :item_id, :item_type, :identifier, :user_id, :user_type
7
7
  end
8
8
 
9
- belongs_to :user, polymorphic: true
9
+ belongs_to :user, polymorphic: true, optional: true
10
10
  belongs_to :item, polymorphic: true
11
11
  has_many :snapshot_items, class_name: 'ActiveSnapshot::SnapshotItem', dependent: :destroy
12
12
 
@@ -11,7 +11,7 @@ module ActiveSnapshot
11
11
 
12
12
  validates :snapshot_id, presence: true
13
13
  validates :item_id, presence: true, uniqueness: { scope: [:snapshot_id, :item_type] }
14
- validates :item_type, presence: true, uniqueness: { scope: [:snapshot_id, :item_id] }
14
+ validates :item_type, presence: true
15
15
 
16
16
  def object
17
17
  return @object if @object
@@ -1,3 +1,3 @@
1
1
  module ActiveSnapshot
2
- VERSION = "0.3.0".freeze
2
+ VERSION = "0.3.1".freeze
3
3
  end
@@ -1,28 +1,31 @@
1
- require "active_record"
2
- require "activerecord-import"
3
-
4
1
  require "active_snapshot/version"
5
2
  require "active_snapshot/config"
6
3
 
7
- require "active_snapshot/models/snapshot"
8
- require "active_snapshot/models/snapshot_item"
4
+ require 'active_support/lazy_load_hooks'
9
5
 
10
- require "active_snapshot/models/concerns/snapshots_concern"
6
+ ActiveSupport.on_load(:active_record) do
7
+ require "activerecord-import"
11
8
 
12
- module ActiveSnapshot
13
- extend ActiveSupport::Concern
9
+ require "active_snapshot/models/snapshot"
10
+ require "active_snapshot/models/snapshot_item"
14
11
 
15
- included do
16
- include ActiveSnapshot::SnapshotsConcern
17
- end
12
+ require "active_snapshot/models/concerns/snapshots_concern"
13
+
14
+ module ActiveSnapshot
15
+ extend ActiveSupport::Concern
16
+
17
+ included do
18
+ include ActiveSnapshot::SnapshotsConcern
19
+ end
18
20
 
19
- @@config = ActiveSnapshot::Config.new
21
+ @@config = ActiveSnapshot::Config.new
20
22
 
21
- def self.config(&block)
22
- if block_given?
23
- block.call(@@config)
24
- else
25
- return @@config
23
+ def self.config(&block)
24
+ if block_given?
25
+ block.call(@@config)
26
+ else
27
+ return @@config
28
+ end
26
29
  end
27
30
  end
28
31
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_snapshot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Weston Ganger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-14 00:00:00.000000000 Z
11
+ date: 2023-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -156,46 +156,6 @@ files:
156
156
  - lib/generators/active_snapshot/install/install_generator.rb
157
157
  - lib/generators/active_snapshot/install/templates/create_snapshots_tables.rb.erb
158
158
  - lib/generators/active_snapshot/migration_generator.rb
159
- - test/dummy_app/Rakefile
160
- - test/dummy_app/app/assets/config/manifest.js
161
- - test/dummy_app/app/assets/javascripts/application.js
162
- - test/dummy_app/app/assets/stylesheets/application.css
163
- - test/dummy_app/app/controllers/application_controller.rb
164
- - test/dummy_app/app/models/application_record.rb
165
- - test/dummy_app/app/models/comment.rb
166
- - test/dummy_app/app/models/note.rb
167
- - test/dummy_app/app/models/parent_without_children.rb
168
- - test/dummy_app/app/models/post.rb
169
- - test/dummy_app/app/models/sub_post.rb
170
- - test/dummy_app/app/models/volatile_post.rb
171
- - test/dummy_app/app/views/layouts/application.html.erb
172
- - test/dummy_app/config.ru
173
- - test/dummy_app/config/application.rb
174
- - test/dummy_app/config/boot.rb
175
- - test/dummy_app/config/database.yml
176
- - test/dummy_app/config/environment.rb
177
- - test/dummy_app/config/environments/test.rb
178
- - test/dummy_app/config/initializers/backtrace_silencers.rb
179
- - test/dummy_app/config/initializers/inflections.rb
180
- - test/dummy_app/config/initializers/mime_types.rb
181
- - test/dummy_app/config/initializers/secret_token.rb
182
- - test/dummy_app/config/initializers/session_store.rb
183
- - test/dummy_app/config/initializers/wrap_parameters.rb
184
- - test/dummy_app/config/locales/en.yml
185
- - test/dummy_app/config/routes.rb
186
- - test/dummy_app/config/secrets.yml
187
- - test/dummy_app/db/migrate/20210128155312_set_up_test_tables.rb
188
- - test/dummy_app/db/migrate/20210306100122_create_snapshots_tables.rb
189
- - test/dummy_app/db/test.sqlite3
190
- - test/dummy_app/log/test.log
191
- - test/generators/active_snapshot/install_generator_test.rb
192
- - test/models/snapshot_item_test.rb
193
- - test/models/snapshot_test.rb
194
- - test/models/snapshots_concern_test.rb
195
- - test/test_helper.rb
196
- - test/unit/active_snapshot_test.rb
197
- - test/unit/config_test.rb
198
- - test/unit/errors_test.rb
199
159
  homepage: https://github.com/westonganger/active_snapshot
200
160
  licenses:
201
161
  - MIT
@@ -217,48 +177,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
217
177
  - !ruby/object:Gem::Version
218
178
  version: '0'
219
179
  requirements: []
220
- rubygems_version: 3.3.7
180
+ rubygems_version: 3.4.6
221
181
  signing_key:
222
182
  specification_version: 4
223
183
  summary: Dead simple snapshot versioning for ActiveRecord models and associations.
224
- test_files:
225
- - test/dummy_app/Rakefile
226
- - test/dummy_app/app/assets/config/manifest.js
227
- - test/dummy_app/app/assets/javascripts/application.js
228
- - test/dummy_app/app/assets/stylesheets/application.css
229
- - test/dummy_app/app/controllers/application_controller.rb
230
- - test/dummy_app/app/models/application_record.rb
231
- - test/dummy_app/app/models/comment.rb
232
- - test/dummy_app/app/models/note.rb
233
- - test/dummy_app/app/models/parent_without_children.rb
234
- - test/dummy_app/app/models/post.rb
235
- - test/dummy_app/app/models/sub_post.rb
236
- - test/dummy_app/app/models/volatile_post.rb
237
- - test/dummy_app/app/views/layouts/application.html.erb
238
- - test/dummy_app/config/application.rb
239
- - test/dummy_app/config/boot.rb
240
- - test/dummy_app/config/database.yml
241
- - test/dummy_app/config/environment.rb
242
- - test/dummy_app/config/environments/test.rb
243
- - test/dummy_app/config/initializers/backtrace_silencers.rb
244
- - test/dummy_app/config/initializers/inflections.rb
245
- - test/dummy_app/config/initializers/mime_types.rb
246
- - test/dummy_app/config/initializers/secret_token.rb
247
- - test/dummy_app/config/initializers/session_store.rb
248
- - test/dummy_app/config/initializers/wrap_parameters.rb
249
- - test/dummy_app/config/locales/en.yml
250
- - test/dummy_app/config/routes.rb
251
- - test/dummy_app/config/secrets.yml
252
- - test/dummy_app/config.ru
253
- - test/dummy_app/db/migrate/20210128155312_set_up_test_tables.rb
254
- - test/dummy_app/db/migrate/20210306100122_create_snapshots_tables.rb
255
- - test/dummy_app/db/test.sqlite3
256
- - test/dummy_app/log/test.log
257
- - test/generators/active_snapshot/install_generator_test.rb
258
- - test/models/snapshot_item_test.rb
259
- - test/models/snapshot_test.rb
260
- - test/models/snapshots_concern_test.rb
261
- - test/test_helper.rb
262
- - test/unit/active_snapshot_test.rb
263
- - test/unit/config_test.rb
264
- - test/unit/errors_test.rb
184
+ test_files: []
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env rake
2
- # Add your own tasks in files placed in lib/tasks ending in .rake,
3
- # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
4
-
5
- require File.expand_path('../config/application', __FILE__)
6
-
7
- Dummy::Application.load_tasks
@@ -1,3 +0,0 @@
1
- //= link_tree ../images
2
- //= link_directory ../javascripts .js
3
- //= link_directory ../stylesheets .css .scss
File without changes
@@ -1,3 +0,0 @@
1
- /*
2
- *= require_self
3
- */
@@ -1,3 +0,0 @@
1
- class ApplicationController < ActionController::Base
2
- protect_from_forgery
3
- end
@@ -1,3 +0,0 @@
1
- class ApplicationRecord < ActiveRecord::Base
2
- self.abstract_class = true
3
- end
@@ -1,5 +0,0 @@
1
- class Comment < ActiveRecord::Base
2
- include ActiveSnapshot
3
-
4
- belongs_to :post
5
- end
@@ -1,5 +0,0 @@
1
- class Note < ActiveRecord::Base
2
- include ActiveSnapshot
3
-
4
- belongs_to :post
5
- end
@@ -1,5 +0,0 @@
1
- class ParentWithoutChildren < ApplicationRecord
2
- include ActiveSnapshot
3
-
4
- self.table_name = "posts"
5
- end
@@ -1,16 +0,0 @@
1
- class Post < ActiveRecord::Base
2
- include ActiveSnapshot
3
-
4
- has_many :comments
5
- has_many :notes
6
-
7
- has_snapshot_children do
8
- instance = self.class.includes(:comments, :notes).find(id)
9
-
10
- {
11
- comments: instance.comments,
12
- notes: instance.notes,
13
- nil_assoc: nil,
14
- }
15
- end
16
- end
@@ -1,11 +0,0 @@
1
- class SubPost < Post
2
- has_snapshot_children do
3
- instance = self.class.includes(:comments, :notes).find(id)
4
-
5
- {
6
- comments: instance.comments,
7
- notes: instance.notes,
8
- nil_assoc: nil,
9
- }
10
- end
11
- end
@@ -1,5 +0,0 @@
1
- class VolatilePost < ActiveRecord::Base
2
- self.table_name = "posts"
3
-
4
- include ActiveSnapshot
5
- end
@@ -1,14 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>Dummy App</title>
5
- <%= stylesheet_link_tag "application" %>
6
- <%= javascript_include_tag "application" %>
7
- <%= csrf_meta_tags %>
8
- </head>
9
- <body>
10
-
11
- <%= yield %>
12
-
13
- </body>
14
- </html>
@@ -1,50 +0,0 @@
1
- require File.expand_path('../boot', __FILE__)
2
-
3
- require 'rails/all'
4
-
5
- Bundler.require
6
-
7
- module Dummy
8
- class Application < Rails::Application
9
- if Rails::VERSION::STRING.to_f >= 5.1
10
- config.load_defaults Rails::VERSION::STRING.to_f
11
- end
12
-
13
- # Settings in config/environments/* take precedence over those specified here.
14
- # Application configuration should go into files in config/initializers
15
- # -- all .rb files in that directory are automatically loaded.
16
-
17
- # Custom directories with classes and modules you want to be autoloadable.
18
- # config.autoload_paths += %W(#{config.root}/extras)
19
-
20
- # Only load the plugins named here, in the order given (default is alphabetical).
21
- # :all can be used as a placeholder for all plugins not explicitly named.
22
- # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
23
-
24
- # Activate observers that should always be running.
25
- # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
26
-
27
- # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
28
- # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
29
- # config.time_zone = 'Central Time (US & Canada)'
30
-
31
- # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
32
- # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
33
- # config.i18n.default_locale = :de
34
-
35
- # Configure the default encoding used in templates for Ruby 1.9.
36
- config.encoding = "utf-8"
37
-
38
- # Configure sensitive parameters which will be filtered from the log file.
39
- config.filter_parameters += [:password]
40
-
41
- config.generators.test_framework = false
42
- config.generators.helper = false
43
- config.generators.stylesheets = false
44
- config.generators.javascripts = false
45
-
46
- config.after_initialize do
47
- ActiveRecord::Migration.migrate(Rails.root.join("db/migrate/*").to_s)
48
- end
49
- end
50
- end
@@ -1,10 +0,0 @@
1
- require 'rubygems'
2
- gemfile = File.expand_path('../../../../Gemfile', __FILE__)
3
-
4
- if File.exist?(gemfile)
5
- ENV['BUNDLE_GEMFILE'] = gemfile
6
- require 'bundler'
7
- Bundler.setup
8
- end
9
-
10
- $:.unshift File.expand_path('../../../../lib', __FILE__)
@@ -1,20 +0,0 @@
1
- default: &default
2
- <% if defined?(Mysql2) %>
3
- adapter: mysql2
4
- database: active_sort_order_test
5
-
6
- <% elsif defined?(PG) %>
7
- adapter: postgresql
8
- database: active_sort_order_test
9
-
10
- <% elsif defined?(SQLite3) %>
11
- adapter: sqlite3
12
- database: db/test.sqlite3
13
-
14
- <% end %>
15
-
16
- development:
17
- <<: *default
18
-
19
- test:
20
- <<: *default
@@ -1,5 +0,0 @@
1
- # Load the rails application
2
- require File.expand_path('../application', __FILE__)
3
-
4
- # Initialize the rails application
5
- Dummy::Application.initialize!
@@ -1,41 +0,0 @@
1
- Dummy::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb
3
-
4
- # The test environment is used exclusively to run your application's
5
- # test suite. You never need to work with it otherwise. Remember that
6
- # your test database is "scratch space" for the test suite and is wiped
7
- # and recreated between test runs. Don't rely on the data there!
8
- config.cache_classes = true
9
-
10
- # Configure static asset server for tests with Cache-Control for performance
11
- config.serve_static_assets = true
12
- config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }
13
-
14
- # Log error messages when you accidentally call methods on nil
15
- config.whiny_nils = true
16
-
17
- # Show full error reports and disable caching
18
- config.consider_all_requests_local = true
19
- config.action_controller.perform_caching = false
20
-
21
- # Raise exceptions instead of rendering exception templates
22
- config.action_dispatch.show_exceptions = false
23
-
24
- # Disable request forgery protection in test environment
25
- config.action_controller.allow_forgery_protection = false
26
-
27
- # Tell Action Mailer not to deliver emails to the real world.
28
- # The :test delivery method accumulates sent emails in the
29
- # ActionMailer::Base.deliveries array.
30
- config.action_mailer.delivery_method = :test
31
-
32
- # Use SQL instead of Active Record's schema dumper when creating the test database.
33
- # This is necessary if your schema can't be completely dumped by the schema dumper,
34
- # like if you have constraints or database-specific column types
35
- # config.active_record.schema_format = :sql
36
-
37
- # Print deprecation notices to the stderr
38
- config.active_support.deprecation = :stderr
39
-
40
- config.eager_load = false
41
- end
@@ -1,7 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
- # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
-
6
- # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
- # Rails.backtrace_cleaner.remove_silencers!
@@ -1,10 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Add new inflection rules using the following format
4
- # (all these examples are active by default):
5
- # ActiveSupport::Inflector.inflections do |inflect|
6
- # inflect.plural /^(ox)$/i, '\1en'
7
- # inflect.singular /^(ox)en/i, '\1'
8
- # inflect.irregular 'person', 'people'
9
- # inflect.uncountable %w( fish sheep )
10
- # end
@@ -1,5 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Add new mime types for use in respond_to blocks:
4
- # Mime::Type.register "text/richtext", :rtf
5
- # Mime::Type.register_alias "text/html", :iphone
@@ -1,11 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Your secret key for verifying the integrity of signed cookies.
4
- # If you change this key, all old signed cookies will become invalid!
5
- # Make sure the secret is at least 30 characters and all random,
6
- # no regular words or you'll be exposed to dictionary attacks.
7
-
8
- gem_version = ActiveRecord.gem_version
9
- if gem_version <= Gem::Version.new("5.1")
10
- Dummy::Application.config.secret_token = '4f337f0063fbb4a724dd8da15419679300da990ae4f6c94d36c714a3cd07e9653fc42d902cf33a9b9449a28e7eb2673f928172d65a090fa3c9156d6beea8d16c'
11
- end
@@ -1,8 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
4
-
5
- # Use the database for sessions instead of the cookie-based default,
6
- # which shouldn't be used to store highly confidential information
7
- # (create the session table with "rails generate session_migration")
8
- # Dummy::Application.config.session_store :active_record_store
@@ -1,14 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
- #
3
- # This file contains settings for ActionController::ParamsWrapper which
4
- # is enabled by default.
5
-
6
- # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
- ActiveSupport.on_load(:action_controller) do
8
- wrap_parameters format: [:json]
9
- end
10
-
11
- # Disable root element in JSON by default.
12
- ActiveSupport.on_load(:active_record) do
13
- self.include_root_in_json = false
14
- end
@@ -1,5 +0,0 @@
1
- # Sample localization file for English. Add more files in this directory for other locales.
2
- # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
-
4
- en:
5
- hello: "Hello world"
@@ -1,6 +0,0 @@
1
- Dummy::Application.routes.draw do
2
- get 'spreadsheets/csv', to: 'spreadsheets#csv'
3
- get 'spreadsheets/ods', to: 'spreadsheets#ods'
4
- get 'spreadsheets/xlsx', to: 'spreadsheets#xlsx'
5
- get 'spreadsheets/alt_xlsx', to: 'spreadsheets#alt_xlsx'
6
- end
@@ -1,22 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Your secret key is used for verifying the integrity of signed cookies.
4
- # If you change this key, all old signed cookies will become invalid!
5
-
6
- # Make sure the secret is at least 30 characters and all random,
7
- # no regular words or you'll be exposed to dictionary attacks.
8
- # You can use `rake secret` to generate a secure secret key.
9
-
10
- # Make sure the secrets in this file are kept private
11
- # if you're sharing your code publicly.
12
-
13
- development:
14
- secret_key_base: d28054e102cd55dcd684cee239d31ddf1e1acd83bd879dd5f671e989f5c9d94ec1ede00e7fcf9b6bde4cd115f93c54e3ba6c5dc05d233292542f27a79706fcb4
15
-
16
- test:
17
- secret_key_base: 378b4f2309d4898f5170b41624e19bf60ce8a154ad87c100e8846bddcf4c28b72b533f2e73738ef8f6eabb7a773a0a0e7c32c0649916c5f280eb7ac621fc318c
18
-
19
- # Do not keep production secrets in the repository,
20
- # instead read values from the environment.
21
- production:
22
- secret_key_base: 5e73c057b92f67f980fbea4c1c2c495b25def0048f8c1c040fed9c08f49cd50a2ebf872dd87857afc0861479e9382fceb7d9837a0bce546c2f7594e2f4da45e3
@@ -1,4 +0,0 @@
1
- # This file is used by Rack-based servers to start the application.
2
-
3
- require ::File.expand_path('../config/environment', __FILE__)
4
- run Dummy::Application