paper_trail 4.2.0 → 7.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (171) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generators/paper_trail/install_generator.rb +91 -17
  3. data/lib/generators/paper_trail/templates/add_object_changes_to_versions.rb.erb +12 -0
  4. data/lib/generators/paper_trail/templates/{add_transaction_id_column_to_versions.rb → add_transaction_id_column_to_versions.rb.erb} +3 -1
  5. data/lib/generators/paper_trail/templates/create_version_associations.rb.erb +22 -0
  6. data/lib/generators/paper_trail/templates/{create_versions.rb → create_versions.rb.erb} +9 -7
  7. data/lib/paper_trail.rb +180 -148
  8. data/lib/paper_trail/attribute_serializers/README.md +10 -0
  9. data/lib/paper_trail/attribute_serializers/cast_attribute_serializer.rb +80 -0
  10. data/lib/paper_trail/attribute_serializers/legacy_active_record_shim.rb +48 -0
  11. data/lib/paper_trail/attribute_serializers/object_attribute.rb +39 -0
  12. data/lib/paper_trail/attribute_serializers/object_changes_attribute.rb +42 -0
  13. data/lib/paper_trail/cleaner.rb +16 -10
  14. data/lib/paper_trail/config.rb +28 -27
  15. data/lib/paper_trail/frameworks/active_record/models/paper_trail/version.rb +5 -1
  16. data/lib/paper_trail/frameworks/active_record/models/paper_trail/version_association.rb +6 -2
  17. data/lib/paper_trail/frameworks/cucumber.rb +1 -0
  18. data/lib/paper_trail/frameworks/rails.rb +2 -7
  19. data/lib/paper_trail/frameworks/rails/controller.rb +20 -18
  20. data/lib/paper_trail/frameworks/rails/engine.rb +6 -1
  21. data/lib/paper_trail/frameworks/rspec.rb +17 -6
  22. data/lib/paper_trail/frameworks/rspec/helpers.rb +3 -1
  23. data/lib/paper_trail/has_paper_trail.rb +25 -503
  24. data/lib/paper_trail/model_config.rb +207 -0
  25. data/lib/paper_trail/queries/versions/where_object.rb +60 -0
  26. data/lib/paper_trail/queries/versions/where_object_changes.rb +68 -0
  27. data/lib/paper_trail/record_history.rb +2 -12
  28. data/lib/paper_trail/record_trail.rb +573 -0
  29. data/lib/paper_trail/reifier.rb +164 -215
  30. data/lib/paper_trail/reifiers/belongs_to.rb +48 -0
  31. data/lib/paper_trail/reifiers/has_and_belongs_to_many.rb +50 -0
  32. data/lib/paper_trail/reifiers/has_many.rb +110 -0
  33. data/lib/paper_trail/reifiers/has_many_through.rb +90 -0
  34. data/lib/paper_trail/reifiers/has_one.rb +76 -0
  35. data/lib/paper_trail/serializers/json.rb +16 -7
  36. data/lib/paper_trail/serializers/yaml.rb +9 -13
  37. data/lib/paper_trail/version_association_concern.rb +3 -5
  38. data/lib/paper_trail/version_concern.rb +138 -111
  39. data/lib/paper_trail/version_number.rb +10 -9
  40. metadata +95 -327
  41. data/.gitignore +0 -22
  42. data/.rspec +0 -2
  43. data/.travis.yml +0 -41
  44. data/CHANGELOG.md +0 -362
  45. data/CONTRIBUTING.md +0 -84
  46. data/Gemfile +0 -2
  47. data/MIT-LICENSE +0 -20
  48. data/README.md +0 -1535
  49. data/Rakefile +0 -30
  50. data/doc/bug_report_template.rb +0 -65
  51. data/gemfiles/ar3.gemfile +0 -61
  52. data/lib/generators/paper_trail/templates/add_object_changes_to_versions.rb +0 -10
  53. data/lib/generators/paper_trail/templates/create_version_associations.rb +0 -17
  54. data/lib/paper_trail/attributes_serialization.rb +0 -89
  55. data/lib/paper_trail/frameworks/sinatra.rb +0 -38
  56. data/paper_trail.gemspec +0 -59
  57. data/spec/generators/install_generator_spec.rb +0 -67
  58. data/spec/models/animal_spec.rb +0 -36
  59. data/spec/models/boolit_spec.rb +0 -48
  60. data/spec/models/callback_modifier_spec.rb +0 -96
  61. data/spec/models/fluxor_spec.rb +0 -19
  62. data/spec/models/gadget_spec.rb +0 -70
  63. data/spec/models/joined_version_spec.rb +0 -47
  64. data/spec/models/json_version_spec.rb +0 -103
  65. data/spec/models/kitchen/banana_spec.rb +0 -14
  66. data/spec/models/not_on_update_spec.rb +0 -19
  67. data/spec/models/post_with_status_spec.rb +0 -17
  68. data/spec/models/skipper_spec.rb +0 -46
  69. data/spec/models/thing_spec.rb +0 -11
  70. data/spec/models/version_spec.rb +0 -239
  71. data/spec/models/widget_spec.rb +0 -298
  72. data/spec/modules/paper_trail_spec.rb +0 -27
  73. data/spec/modules/version_concern_spec.rb +0 -32
  74. data/spec/modules/version_number_spec.rb +0 -44
  75. data/spec/paper_trail/config_spec.rb +0 -52
  76. data/spec/paper_trail_spec.rb +0 -66
  77. data/spec/rails_helper.rb +0 -34
  78. data/spec/requests/articles_spec.rb +0 -30
  79. data/spec/spec_helper.rb +0 -95
  80. data/spec/support/alt_db_init.rb +0 -59
  81. data/test/custom_json_serializer.rb +0 -13
  82. data/test/dummy/Rakefile +0 -7
  83. data/test/dummy/app/controllers/application_controller.rb +0 -20
  84. data/test/dummy/app/controllers/articles_controller.rb +0 -17
  85. data/test/dummy/app/controllers/test_controller.rb +0 -5
  86. data/test/dummy/app/controllers/widgets_controller.rb +0 -31
  87. data/test/dummy/app/helpers/application_helper.rb +0 -2
  88. data/test/dummy/app/models/animal.rb +0 -6
  89. data/test/dummy/app/models/article.rb +0 -16
  90. data/test/dummy/app/models/authorship.rb +0 -5
  91. data/test/dummy/app/models/book.rb +0 -9
  92. data/test/dummy/app/models/boolit.rb +0 -4
  93. data/test/dummy/app/models/callback_modifier.rb +0 -45
  94. data/test/dummy/app/models/cat.rb +0 -2
  95. data/test/dummy/app/models/chapter.rb +0 -9
  96. data/test/dummy/app/models/citation.rb +0 -5
  97. data/test/dummy/app/models/customer.rb +0 -4
  98. data/test/dummy/app/models/document.rb +0 -4
  99. data/test/dummy/app/models/dog.rb +0 -2
  100. data/test/dummy/app/models/editor.rb +0 -4
  101. data/test/dummy/app/models/editorship.rb +0 -5
  102. data/test/dummy/app/models/elephant.rb +0 -3
  103. data/test/dummy/app/models/fluxor.rb +0 -3
  104. data/test/dummy/app/models/foo_widget.rb +0 -2
  105. data/test/dummy/app/models/fruit.rb +0 -5
  106. data/test/dummy/app/models/gadget.rb +0 -3
  107. data/test/dummy/app/models/kitchen/banana.rb +0 -5
  108. data/test/dummy/app/models/legacy_widget.rb +0 -4
  109. data/test/dummy/app/models/line_item.rb +0 -4
  110. data/test/dummy/app/models/not_on_update.rb +0 -4
  111. data/test/dummy/app/models/order.rb +0 -5
  112. data/test/dummy/app/models/paragraph.rb +0 -5
  113. data/test/dummy/app/models/person.rb +0 -38
  114. data/test/dummy/app/models/post.rb +0 -3
  115. data/test/dummy/app/models/post_with_status.rb +0 -8
  116. data/test/dummy/app/models/protected_widget.rb +0 -3
  117. data/test/dummy/app/models/quotation.rb +0 -5
  118. data/test/dummy/app/models/section.rb +0 -6
  119. data/test/dummy/app/models/skipper.rb +0 -6
  120. data/test/dummy/app/models/song.rb +0 -32
  121. data/test/dummy/app/models/thing.rb +0 -3
  122. data/test/dummy/app/models/translation.rb +0 -4
  123. data/test/dummy/app/models/whatchamajigger.rb +0 -4
  124. data/test/dummy/app/models/widget.rb +0 -15
  125. data/test/dummy/app/models/wotsit.rb +0 -8
  126. data/test/dummy/app/versions/joined_version.rb +0 -5
  127. data/test/dummy/app/versions/json_version.rb +0 -3
  128. data/test/dummy/app/versions/kitchen/banana_version.rb +0 -5
  129. data/test/dummy/app/versions/post_version.rb +0 -3
  130. data/test/dummy/app/views/layouts/application.html.erb +0 -14
  131. data/test/dummy/config.ru +0 -4
  132. data/test/dummy/config/application.rb +0 -69
  133. data/test/dummy/config/boot.rb +0 -10
  134. data/test/dummy/config/database.mysql.yml +0 -19
  135. data/test/dummy/config/database.postgres.yml +0 -15
  136. data/test/dummy/config/database.sqlite.yml +0 -15
  137. data/test/dummy/config/environment.rb +0 -5
  138. data/test/dummy/config/environments/development.rb +0 -40
  139. data/test/dummy/config/environments/production.rb +0 -73
  140. data/test/dummy/config/environments/test.rb +0 -41
  141. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
  142. data/test/dummy/config/initializers/inflections.rb +0 -10
  143. data/test/dummy/config/initializers/mime_types.rb +0 -5
  144. data/test/dummy/config/initializers/paper_trail.rb +0 -10
  145. data/test/dummy/config/initializers/secret_token.rb +0 -7
  146. data/test/dummy/config/initializers/session_store.rb +0 -8
  147. data/test/dummy/config/locales/en.yml +0 -5
  148. data/test/dummy/config/routes.rb +0 -4
  149. data/test/dummy/db/migrate/20110208155312_set_up_test_tables.rb +0 -287
  150. data/test/dummy/db/schema.rb +0 -246
  151. data/test/dummy/script/rails +0 -6
  152. data/test/functional/controller_test.rb +0 -91
  153. data/test/functional/enabled_for_controller_test.rb +0 -29
  154. data/test/functional/modular_sinatra_test.rb +0 -48
  155. data/test/functional/sinatra_test.rb +0 -49
  156. data/test/functional/thread_safety_test.rb +0 -48
  157. data/test/paper_trail_test.rb +0 -38
  158. data/test/test_helper.rb +0 -105
  159. data/test/time_travel_helper.rb +0 -15
  160. data/test/unit/associations_test.rb +0 -726
  161. data/test/unit/cleaner_test.rb +0 -182
  162. data/test/unit/inheritance_column_test.rb +0 -43
  163. data/test/unit/model_test.rb +0 -1373
  164. data/test/unit/protected_attrs_test.rb +0 -47
  165. data/test/unit/serializer_test.rb +0 -117
  166. data/test/unit/serializers/json_test.rb +0 -88
  167. data/test/unit/serializers/mixin_json_test.rb +0 -36
  168. data/test/unit/serializers/mixin_yaml_test.rb +0 -49
  169. data/test/unit/serializers/yaml_test.rb +0 -52
  170. data/test/unit/timestamp_test.rb +0 -43
  171. data/test/unit/version_test.rb +0 -119
@@ -1,3 +0,0 @@
1
- class Thing < ActiveRecord::Base
2
- has_paper_trail :save_changes => false
3
- end
@@ -1,4 +0,0 @@
1
- class Translation < ActiveRecord::Base
2
- has_paper_trail :if => Proc.new { |t| t.language_code == 'US' },
3
- :unless => Proc.new { |t| t.type == 'DRAFT' }
4
- end
@@ -1,4 +0,0 @@
1
- class Whatchamajigger < ActiveRecord::Base
2
- has_paper_trail
3
- belongs_to :owner, :polymorphic => true
4
- end
@@ -1,15 +0,0 @@
1
- class Widget < ActiveRecord::Base
2
- has_paper_trail
3
- has_one :wotsit
4
- has_many :whatchamajiggers, :as => :owner
5
-
6
- EXCLUDED_NAME = 'Biglet'
7
-
8
- validates :name, :exclusion => { :in => [EXCLUDED_NAME] }
9
-
10
- if ::ActiveRecord::VERSION::MAJOR >= 4 # `has_many` syntax for specifying order uses a lambda in Rails 4
11
- has_many :fluxors, lambda { order(:name) }
12
- else
13
- has_many :fluxors, :order => :name
14
- end
15
- end
@@ -1,8 +0,0 @@
1
- class Wotsit < ActiveRecord::Base
2
- has_paper_trail
3
- belongs_to :widget
4
-
5
- def created_on
6
- created_at.to_date
7
- end
8
- end
@@ -1,5 +0,0 @@
1
- # The purpose of this custom version class is to test the scope methods on the VersionConcern::ClassMethods
2
- # module. See https://github.com/airblade/paper_trail/issues/295 for more details.
3
- class JoinedVersion < PaperTrail::Version
4
- default_scope { joins('INNER JOIN widgets ON widgets.id = versions.item_id') }
5
- end
@@ -1,3 +0,0 @@
1
- class JsonVersion < PaperTrail::Version
2
- self.table_name = 'json_versions'
3
- end
@@ -1,5 +0,0 @@
1
- module Kitchen
2
- class BananaVersion < PaperTrail::Version
3
- self.table_name = 'banana_versions'
4
- end
5
- end
@@ -1,3 +0,0 @@
1
- class PostVersion < PaperTrail::Version
2
- self.table_name = 'post_versions'
3
- end
@@ -1,14 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>Dummy</title>
5
- <%= stylesheet_link_tag :all %>
6
- <%= javascript_include_tag :defaults %>
7
- <%= csrf_meta_tag %>
8
- </head>
9
- <body>
10
-
11
- <%= yield %>
12
-
13
- </body>
14
- </html>
data/test/dummy/config.ru DELETED
@@ -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
@@ -1,69 +0,0 @@
1
- require File.expand_path('../boot', __FILE__)
2
-
3
- # Pick the frameworks you want:
4
- require "active_record/railtie"
5
- require "action_controller/railtie"
6
-
7
- Bundler.require(:default, Rails.env) if defined?(Bundler)
8
- require 'paper_trail'
9
-
10
- module Dummy
11
- class Application < Rails::Application
12
- # Settings in config/environments/* take precedence over those specified here.
13
- # Application configuration should go into files in config/initializers
14
- # -- all .rb files in that directory are automatically loaded.
15
-
16
- # Custom directories with classes and modules you want to be autoloadable.
17
- # config.autoload_paths += %W(#{config.root}/extras)
18
-
19
- # Only load the plugins named here, in the order given (default is alphabetical).
20
- # :all can be used as a placeholder for all plugins not explicitly named.
21
- # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
22
-
23
- # Activate observers that should always be running.
24
- # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
25
-
26
- # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
27
- # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
28
- # config.time_zone = 'Central Time (US & Canada)'
29
-
30
- # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
31
- # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
32
- # config.i18n.default_locale = :de
33
-
34
- # Configure the default encoding used in templates for Ruby 1.9.
35
- config.encoding = "utf-8"
36
-
37
- # Configure sensitive parameters which will be filtered from the log file.
38
- config.filter_parameters += [:password]
39
-
40
- # Enable escaping HTML in JSON.
41
- config.active_support.escape_html_entities_in_json = true
42
-
43
- # Use SQL instead of Active Record's schema dumper when creating the database.
44
- # This is necessary if your schema can't be completely dumped by the schema dumper,
45
- # like if you have constraints or database-specific column types
46
- # config.active_record.schema_format = :sql
47
-
48
- # Enforce whitelist mode for mass assignment.
49
- # This will create an empty whitelist of attributes available for mass-assignment for all models
50
- # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
51
- # parameters by using an attr_accessible or attr_protected declaration.
52
- config.active_record.whitelist_attributes = false if ::PaperTrail.active_record_protected_attributes?
53
-
54
- # Enable the asset pipeline
55
- config.assets.enabled = false
56
-
57
- # Version of your assets, change this if you want to expire all your assets
58
- # config.assets.version = '1.0'
59
-
60
- # Rails 4 key for generating secret key
61
- config.secret_key_base = 'A fox regularly kicked the screaming pile of biscuits.'
62
-
63
- # supress warnings about raises in transactional callbacks on AR 4.2+
64
- config.active_record.raise_in_transactional_callbacks = true if ActiveRecord::VERSION::STRING >= '4.2'
65
-
66
- # Set test order for Test::Unit if possible
67
- config.active_support.test_order = :sorted if config.active_support.respond_to?(:test_order=)
68
- end
69
- 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,19 +0,0 @@
1
- test: &test
2
- adapter: mysql2
3
- encoding: utf8
4
- database: paper_trail_test
5
- pool: 5
6
- username: root
7
- password:
8
- host: localhost
9
-
10
- # Warning: The database defined as "test" will be erased and
11
- # re-generated from your development database when you run "rake".
12
- # Do not set this db to the same as development or production.
13
- foo:
14
- <<: *test
15
- database: paper_trail_foo
16
-
17
- bar:
18
- <<: *test
19
- database: paper_trail_bar
@@ -1,15 +0,0 @@
1
- test: &test
2
- adapter: postgresql
3
- database: paper_trail_test
4
- username: postgres
5
- password:
6
- host: localhost
7
- port: 5432
8
-
9
- foo:
10
- <<: *test
11
- database: paper_trail_foo
12
-
13
- bar:
14
- <<: *test
15
- database: paper_trail_bar
@@ -1,15 +0,0 @@
1
- # SQLite version 3.x
2
- # gem install sqlite3-ruby (not necessary on OS X Leopard)
3
- test: &test
4
- adapter: sqlite3
5
- pool: 5
6
- timeout: 5000
7
- database: db/test.sqlite3
8
-
9
- foo:
10
- <<: *test
11
- database: db/test-foo.sqlite3
12
-
13
- bar:
14
- <<: *test
15
- database: db/test-bar.sqlite3
@@ -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,40 +0,0 @@
1
- Dummy::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb
3
-
4
- # In the development environment your application's code is reloaded on
5
- # every request. This slows down response time but is perfect for development
6
- # since you don't have to restart the web server when you make code changes.
7
- config.cache_classes = false
8
-
9
- # Do not eager load code on boot.
10
- config.eager_load = false
11
-
12
- # Show full error reports and disable caching
13
- config.consider_all_requests_local = true
14
- config.action_controller.perform_caching = false
15
-
16
- # Don't care if the mailer can't send
17
- # config.action_mailer.raise_delivery_errors = false
18
-
19
- # Print deprecation notices to the Rails logger
20
- config.active_support.deprecation = :log
21
-
22
- # Only use best-standards-support built into browsers
23
- config.action_dispatch.best_standards_support = :builtin
24
-
25
- # Raise exception on mass assignment protection for Active Record models
26
- config.active_record.mass_assignment_sanitizer = :strict if ::PaperTrail.active_record_protected_attributes?
27
-
28
- # Log the query plan for queries taking more than this (works
29
- # with SQLite, MySQL, and PostgreSQL)
30
- # config.active_record.auto_explain_threshold_in_seconds = 0.5
31
-
32
- # Do not compress assets
33
- config.assets.compress = false
34
-
35
- # Debug mode disables concatenation and preprocessing of assets.
36
- # This option may cause significant delays in view rendering with a large
37
- # number of complex assets.
38
- config.assets.debug = true
39
- end
40
-
@@ -1,73 +0,0 @@
1
- Dummy::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb
3
-
4
- # Code is not reloaded between requests
5
- config.cache_classes = true
6
-
7
- # Eager load code on boot. This eager loads most of Rails and
8
- # your application in memory, allowing both thread web servers
9
- # and those relying on copy on write to perform better.
10
- # Rake tasks automatically ignore this option for performance.
11
- config.eager_load = true
12
-
13
- # Full error reports are disabled and caching is turned on
14
- config.consider_all_requests_local = false
15
- config.action_controller.perform_caching = true
16
-
17
- # Disable Rails's static asset server (Apache or nginx will already do this)
18
- config.serve_static_assets = false
19
-
20
- # Compress JavaScripts and CSS
21
- config.assets.compress = true
22
-
23
- # Don't fallback to assets pipeline if a precompiled asset is missed
24
- config.assets.compile = false
25
-
26
- # Generate digests for assets URLs
27
- config.assets.digest = true
28
-
29
- # Defaults to nil and saved in location specified by config.assets.prefix
30
- # config.assets.manifest = YOUR_PATH
31
-
32
- # Specifies the header that your server uses for sending files
33
- # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
34
- # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
35
-
36
- # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
37
- # config.force_ssl = true
38
-
39
- # See everything in the log (default is :info)
40
- # config.log_level = :debug
41
-
42
- # Prepend all log lines with the following tags
43
- # config.log_tags = [ :subdomain, :uuid ]
44
-
45
- # Use a different logger for distributed setups
46
- # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
47
-
48
- # Use a different cache store in production
49
- # config.cache_store = :mem_cache_store
50
-
51
- # Enable serving of images, stylesheets, and JavaScripts from an asset server
52
- # config.action_controller.asset_host = "http://assets.example.com"
53
-
54
- # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
55
- # config.assets.precompile += %w( search.js )
56
-
57
- # Disable delivery errors, bad email addresses will be ignored
58
- # config.action_mailer.raise_delivery_errors = false
59
-
60
- # Enable threaded mode
61
- # config.threadsafe!
62
-
63
- # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
64
- # the I18n.default_locale when a translation can not be found)
65
- config.i18n.fallbacks = true
66
-
67
- # Send deprecation notices to registered listeners
68
- config.active_support.deprecation = :notify
69
-
70
- # Log the query plan for queries taking more than this (works
71
- # with SQLite, MySQL, and PostgreSQL)
72
- # config.active_record.auto_explain_threshold_in_seconds = 0.5
73
- end
@@ -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
- # Eager loads all registered namespaces
11
- config.eager_load = true
12
-
13
- # Configure static asset server for tests with Cache-Control for performance
14
- if config.respond_to?(:serve_static_files=)
15
- config.serve_static_files = true
16
- else
17
- config.serve_static_assets = true
18
- end
19
- config.static_cache_control = "public, max-age=3600"
20
-
21
- # Show full error reports and disable caching
22
- config.consider_all_requests_local = true
23
- config.action_controller.perform_caching = false
24
-
25
- # Raise exceptions instead of rendering exception templates
26
- config.action_dispatch.show_exceptions = false
27
-
28
- # Disable request forgery protection in test environment
29
- config.action_controller.allow_forgery_protection = false
30
-
31
- # Tell Action Mailer not to deliver emails to the real world.
32
- # The :test delivery method accumulates sent emails in the
33
- # ActionMailer::Base.deliveries array.
34
- # config.action_mailer.delivery_method = :test
35
-
36
- # Raise exception on mass assignment protection for Active Record models
37
- config.active_record.mass_assignment_sanitizer = :strict if ::PaperTrail.active_record_protected_attributes?
38
-
39
- # Print deprecation notices to the stderr
40
- config.active_support.deprecation = :stderr
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,10 +0,0 @@
1
- # Turn on associations tracking when the test suite is run on Travis CI
2
- PaperTrail.config.track_associations = true if ENV['TRAVIS']
3
-
4
- module PaperTrail
5
- class Version < ActiveRecord::Base
6
- if ::PaperTrail.active_record_protected_attributes?
7
- attr_accessible :answer, :action, :question, :article_id, :ip, :user_agent, :title
8
- end
9
- end
10
- end
@@ -1,7 +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
- Dummy::Application.config.secret_token = '99c0312cf416079a8c7ccc63acb1e9f4f17741398ec8022a2f4fb509c57f55b72486573e9816a026f507efbcd452a9e954d45c93c95d5bacd87e664ad6805d3f'