active_scaffold 3.6.20 → 3.7.0

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 (96) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.rdoc +27 -0
  3. data/README.md +27 -16
  4. data/app/assets/javascripts/jquery/active_scaffold.js +38 -6
  5. data/app/assets/javascripts/jquery/active_scaffold_chosen.js +6 -5
  6. data/app/assets/javascripts/jquery/tiny_mce_bridge.js +18 -4
  7. data/app/assets/stylesheets/active_scaffold_layout.css +12 -1
  8. data/app/views/active_scaffold_overrides/_base_form.html.erb +5 -1
  9. data/app/views/active_scaffold_overrides/_field_search.html.erb +1 -0
  10. data/app/views/active_scaffold_overrides/_render_field.js.erb +19 -11
  11. data/config/locales/ja.yml +59 -59
  12. data/lib/active_scaffold/actions/common_search.rb +2 -2
  13. data/lib/active_scaffold/actions/core.rb +30 -10
  14. data/lib/active_scaffold/actions/field_search.rb +9 -6
  15. data/lib/active_scaffold/actions/nested.rb +7 -7
  16. data/lib/active_scaffold/attribute_params.rb +19 -57
  17. data/lib/active_scaffold/bridges/active_storage/active_storage_helpers.rb +0 -3
  18. data/lib/active_scaffold/bridges/active_storage/list_ui.rb +1 -1
  19. data/lib/active_scaffold/bridges/active_storage.rb +3 -0
  20. data/lib/active_scaffold/bridges/bitfields/bitfields_bridge.rb +2 -2
  21. data/lib/active_scaffold/bridges/date_picker/helper.rb +4 -4
  22. data/lib/active_scaffold/bridges/paper_trail/actions.rb +4 -1
  23. data/lib/active_scaffold/bridges/record_select/helpers.rb +2 -2
  24. data/lib/active_scaffold/bridges/tiny_mce.rb +1 -1
  25. data/lib/active_scaffold/bridges/usa_state_select/usa_state_select_helper.rb +1 -6
  26. data/lib/active_scaffold/config/core.rb +1 -1
  27. data/lib/active_scaffold/config/field_search.rb +9 -1
  28. data/lib/active_scaffold/config/form.rb +9 -1
  29. data/lib/active_scaffold/core.rb +2 -8
  30. data/lib/active_scaffold/data_structures/action_columns.rb +0 -25
  31. data/lib/active_scaffold/data_structures/action_links.rb +1 -1
  32. data/lib/active_scaffold/data_structures/association/abstract.rb +8 -0
  33. data/lib/active_scaffold/data_structures/association/active_mongoid.rb +8 -0
  34. data/lib/active_scaffold/data_structures/association/active_record.rb +1 -13
  35. data/lib/active_scaffold/data_structures/association/mongoid.rb +21 -8
  36. data/lib/active_scaffold/data_structures/column.rb +31 -5
  37. data/lib/active_scaffold/data_structures/columns.rb +12 -12
  38. data/lib/active_scaffold/data_structures/nested_info.rb +12 -0
  39. data/lib/active_scaffold/data_structures/sorting.rb +1 -1
  40. data/lib/active_scaffold/engine.rb +0 -1
  41. data/lib/active_scaffold/extensions/action_view_rendering.rb +13 -5
  42. data/lib/active_scaffold/extensions/cow_proxy.rb +1 -1
  43. data/lib/active_scaffold/extensions/unsaved_record.rb +9 -3
  44. data/lib/active_scaffold/finder.rb +5 -1
  45. data/lib/active_scaffold/helpers/action_link_helpers.rb +1 -1
  46. data/lib/active_scaffold/helpers/form_column_helpers.rb +48 -22
  47. data/lib/active_scaffold/helpers/list_column_helpers.rb +3 -2
  48. data/lib/active_scaffold/helpers/search_column_helpers.rb +8 -2
  49. data/lib/active_scaffold/helpers/view_helpers.rb +1 -1
  50. data/lib/active_scaffold/registry.rb +10 -15
  51. data/lib/active_scaffold/tableless.rb +10 -79
  52. data/lib/active_scaffold/version.rb +2 -2
  53. data/lib/active_scaffold.rb +0 -7
  54. data/lib/generators/active_scaffold/install_generator.rb +2 -2
  55. data/test/bridges/bridge_test.rb +1 -1
  56. data/test/bridges/paperclip_test.rb +16 -13
  57. data/test/bridges/tiny_mce_test.rb +1 -1
  58. data/test/config/base_test.rb +1 -1
  59. data/test/config/core_test.rb +1 -1
  60. data/test/config/create_test.rb +1 -1
  61. data/test/config/delete_test.rb +1 -1
  62. data/test/config/field_search_test.rb +1 -1
  63. data/test/config/list_test.rb +1 -1
  64. data/test/config/nested_test.rb +1 -1
  65. data/test/config/search_test.rb +1 -1
  66. data/test/config/show_test.rb +1 -1
  67. data/test/config/subform_test.rb +1 -1
  68. data/test/config/update_test.rb +1 -1
  69. data/test/data_structures/action_columns_test.rb +1 -1
  70. data/test/data_structures/action_link_test.rb +1 -1
  71. data/test/data_structures/action_links_test.rb +1 -1
  72. data/test/data_structures/actions_test.rb +1 -1
  73. data/test/data_structures/association_column_test.rb +1 -1
  74. data/test/data_structures/column_test.rb +1 -1
  75. data/test/data_structures/columns_test.rb +1 -1
  76. data/test/data_structures/set_test.rb +1 -1
  77. data/test/data_structures/sorting_test.rb +1 -1
  78. data/test/data_structures/standard_column_test.rb +1 -1
  79. data/test/data_structures/validation_reflection_test.rb +1 -1
  80. data/test/data_structures/virtual_column_test.rb +1 -1
  81. data/test/extensions/active_record_test.rb +1 -1
  82. data/test/helpers/pagination_helpers_test.rb +1 -1
  83. data/test/misc/active_record_permissions_test.rb +1 -1
  84. data/test/misc/attribute_params_test.rb +1 -1
  85. data/test/misc/calculation_test.rb +1 -1
  86. data/test/misc/configurable_test.rb +1 -1
  87. data/test/misc/constraints_test.rb +1 -1
  88. data/test/misc/convert_numbers_format_test.rb +1 -1
  89. data/test/misc/finder_test.rb +1 -1
  90. data/test/misc/lang_test.rb +1 -1
  91. data/test/misc/parse_datetime_test.rb +1 -1
  92. data/test/misc/tableless_test.rb +1 -1
  93. data/test/test_helper.rb +4 -4
  94. metadata +5 -13
  95. data/lib/active_scaffold/delayed_setup.rb +0 -41
  96. data/lib/active_scaffold/extensions/left_outer_joins.rb +0 -43
@@ -4,24 +4,6 @@ class ActiveScaffold::Tableless < ActiveRecord::Base # rubocop:disable Rails/App
4
4
  def self.scope(association, connection)
5
5
  INSTANCE.scope association, connection
6
6
  end
7
-
8
- if Rails.version < '5.0.0'
9
- def column_for(table_name, column_name, alias_tracker = nil)
10
- klass = alias_tracker ? alias_tracker.connection.klass : self.klass
11
- if table_name == klass.table_name
12
- klass.columns_hash[column_name]
13
- elsif alias_tracker && (klass = alias_tracker.instance_variable_get(:@assoc_klass))
14
- klass.columns_hash[column_name]
15
- else # rails < 4.1
16
- association.klass.columns_hash[column_name]
17
- end
18
- end
19
-
20
- def add_constraints(scope, owner, assoc_klass, refl, tracker)
21
- tracker.instance_variable_set(:@assoc_klass, assoc_klass)
22
- super
23
- end
24
- end
25
7
  end
26
8
 
27
9
  class Connection < ActiveRecord::ConnectionAdapters::AbstractAdapter
@@ -43,33 +25,15 @@ class ActiveScaffold::Tableless < ActiveRecord::Base # rubocop:disable Rails/App
43
25
  end
44
26
 
45
27
  class Column < ActiveRecord::ConnectionAdapters::Column
46
- if Rails.version >= '5.0.0'
47
- def initialize(name, default, sql_type = nil, null = true, **)
48
- metadata = ActiveRecord::Base.connection.send :fetch_type_metadata, sql_type
49
- super(name, default, metadata, null)
50
- end
51
- else
52
- def initialize(name, default, sql_type = nil, null = true)
53
- cast_type = ActiveRecord::Base.connection.send :lookup_cast_type, sql_type
54
- super(name, default, cast_type, sql_type, null)
55
- end
28
+ def initialize(name, default, sql_type = nil, null = true, **)
29
+ metadata = ActiveRecord::Base.connection.send :fetch_type_metadata, sql_type
30
+ super(name, default, metadata, null)
56
31
  end
57
32
  end
58
33
 
59
34
  module Tableless
60
- if Rails.version < '5.2.0'
61
- def skip_statement_cache?
62
- klass < ActiveScaffold::Tableless ? true : super
63
- end
64
-
65
- def association_scope
66
- @association_scope ||= AssociationScope.scope(self, klass.connection) if klass < ActiveScaffold::Tableless
67
- super
68
- end
69
- else
70
- def skip_statement_cache?(scope)
71
- klass < ActiveScaffold::Tableless ? true : super
72
- end
35
+ def skip_statement_cache?(scope)
36
+ klass < ActiveScaffold::Tableless ? true : super
73
37
  end
74
38
 
75
39
  def target_scope
@@ -186,18 +150,11 @@ class ActiveScaffold::Tableless < ActiveRecord::Base # rubocop:disable Rails/App
186
150
  private
187
151
 
188
152
  def relation
189
- args = [self]
190
- if Rails.version < '5.2.0'
191
- args << arel_table
192
- args << predicate_builder if Rails.version >= '5.0.0'
193
- end
194
- ActiveScaffold::Tableless::Relation.new(*args)
153
+ ActiveScaffold::Tableless::Relation.new(self)
195
154
  end
196
155
 
197
- if Rails.version >= '5.2'
198
- def cached_find_by_statement(key, &block)
199
- StatementCache.new(key, self, &block)
200
- end
156
+ def cached_find_by_statement(key, &block)
157
+ StatementCache.new(key, self, &block)
201
158
  end
202
159
  end
203
160
 
@@ -207,34 +164,8 @@ class ActiveScaffold::Tableless < ActiveRecord::Base # rubocop:disable Rails/App
207
164
  @model = model
208
165
  end
209
166
 
210
- if Rails.version < '5.2' # 5.0 and 5.1
211
- def execute(values, model, connection)
212
- model.where(@key => values)
213
- end
214
- else
215
- def execute(values, connection)
216
- @model.where(@key => values)
217
- end
218
- end
219
- end
220
- if Rails.version < '5.0' # 4.2.x
221
- def self.columns_hash
222
- if self < ActiveScaffold::Tableless
223
- @columns_hash ||= Hash[columns.map { |c| [c.name, c] }]
224
- else
225
- super
226
- end
227
- end
228
-
229
- def self.initialize_find_by_cache
230
- self.find_by_statement_cache = Hash.new { |h, k| h[k] = StatementCache.new(k) } # rubocop:disable Rails/DynamicFindBy
231
- end
232
- elsif Rails.version < '5.2' # 5.0 and 5.1
233
- def self.initialize_find_by_cache
234
- @find_by_statement_cache = {
235
- true => Hash.new { |h, k| h[k] = StatementCache.new(k) },
236
- false => Hash.new { |h, k| h[k] = StatementCache.new(k) }
237
- }
167
+ def execute(values, connection)
168
+ @model.where(@key => values)
238
169
  end
239
170
  end
240
171
 
@@ -1,8 +1,8 @@
1
1
  module ActiveScaffold
2
2
  module Version
3
3
  MAJOR = 3
4
- MINOR = 6
5
- PATCH = 20
4
+ MINOR = 7
5
+ PATCH = 0
6
6
 
7
7
  STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
@@ -5,7 +5,6 @@ module ActiveScaffold
5
5
  autoload :Configurable, 'active_scaffold/configurable'
6
6
  autoload :Constraints, 'active_scaffold/constraints'
7
7
  autoload :Core, 'active_scaffold/core'
8
- autoload :DelayedSetup, 'active_scaffold/delayed_setup'
9
8
  autoload :Finder, 'active_scaffold/finder'
10
9
  autoload :MarkedModel, 'active_scaffold/marked_model'
11
10
  autoload :OrmChecks, 'active_scaffold/orm_checks'
@@ -45,7 +44,6 @@ module ActiveScaffold
45
44
  class ActionNotAllowed < RuntimeError; end
46
45
  class ReverseAssociationRequired < RuntimeError; end
47
46
 
48
- mattr_accessor :delayed_setup, instance_writer: false
49
47
  mattr_accessor :stylesheets, instance_writer: false
50
48
  self.stylesheets = []
51
49
  mattr_accessor :javascripts, instance_writer: false
@@ -84,11 +82,6 @@ module ActiveScaffold
84
82
  File.dirname(__FILE__) + '/..'
85
83
  end
86
84
 
87
- def self.set_defaults(&block) # rubocop:disable Naming/AccessorMethodName
88
- ActiveSupport::Deprecation.warn 'use ActiveScaffold.defaults'
89
- defaults(&block)
90
- end
91
-
92
85
  def self.defaults(&block)
93
86
  ActiveScaffold::Config::Core.configure(&block)
94
87
  end
@@ -37,7 +37,7 @@ module ActiveScaffold
37
37
  file = 'app/assets/stylesheets/application.css'
38
38
  return unless File.exist?(file)
39
39
  original_css = File.binread(file)
40
- if original_css =~ /require active_scaffold$/
40
+ if original_css.match?(/require active_scaffold$/)
41
41
  say_status('skipped', 'insert into app/assets/stylesheets/application.css', :yellow)
42
42
  else
43
43
  insert_into_file 'app/assets/stylesheets/application.css', before: %r{[ ]*\*/} do
@@ -68,7 +68,7 @@ module ActiveScaffold
68
68
  say_status('create', file)
69
69
  end
70
70
  insert_into_file 'app/views/layouts/application.html.erb', after: /javascript_pack_tag 'application'.*\n/ do
71
- " <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>\n"
71
+ " <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload', 'data-turbo-track': 'reload' %>\n"
72
72
  end
73
73
  append_to_file 'config/initializers/assets.rb' do
74
74
  "Rails.application.config.assets.precompile += %w( application.js )\n"
@@ -1,6 +1,6 @@
1
1
  require 'test_helper'
2
2
 
3
- class BridgeTest < MiniTest::Test
3
+ class BridgeTest < Minitest::Test
4
4
  def setup
5
5
  @const_store = {}
6
6
  end
@@ -60,22 +60,25 @@ class PaperclipTest < ActionView::TestCase
60
60
  @record = Company.new
61
61
 
62
62
  @record.stubs(:logo).returns(stub(:file? => true, :original_filename => 'file', :url => '/system/file', :styles => Company.attachment_definitions[:logo]))
63
- quote = '&#39;'
64
- click_js = "jQuery(this).prev().val(#{quote}true#{quote}); jQuery(this).parent().hide().next().show(); return false;"
65
- change_js = "jQuery(this).parents(#{quote}div.paperclip_controls#{quote}).find(#{quote}input.remove_file#{quote}).val(#{quote}false#{quote}); return false;"
66
- template = [
67
- '<div class="paperclip_controls"><div>',
68
- '<a href="/system/file" target="_blank">file</a> | ',
69
- '<input name="record[delete_logo]" type="hidden" class="remove_file" id="record_delete_logo" value="false" />',
70
- %(<a href="#" onclick="#{click_js}">Remove or Replace file</a>),
71
- '</div><div style="display: none">',
72
- %(<input name="record[logo]" class="text-input" autocomplete="off" type="file" id="record_logo" onchange="#{change_js}" />),
73
- '</div></div>'
74
- ].join
75
- assert_dom_equal template, active_scaffold_input_paperclip(config.columns[:logo], :name => 'record[logo]', :id => 'record_logo', :object => @record)
63
+ click_js = "jQuery(this).prev().val('true'); jQuery(this).parent().hide().next().show(); return false;"
64
+ change_js = "jQuery(this).parents('div.paperclip_controls').find('input.remove_file').val('false'); return false;"
65
+ @document = Nokogiri::HTML::Document.parse(active_scaffold_input_paperclip(config.columns[:logo], :name => 'record[logo]', :id => 'record_logo', :object => @record))
66
+ assert_select 'div.paperclip_controls input[type=file]' do |match|
67
+ assert_equal match[0]['onchange'], change_js
68
+ end
69
+ assert_select 'div.paperclip_controls a[href="#"][onclick]' do |match|
70
+ assert_equal match[0]['onclick'], click_js
71
+ end
72
+ assert_select 'div.paperclip_controls input.remove_file[type=hidden][value=false]'
76
73
 
77
74
  @record.stubs(:logo).returns(stub(:file? => false))
78
75
  assert_dom_equal '<input name="record[logo]" class="text-input" autocomplete="off" type="file" id="record_logo" />', active_scaffold_input_paperclip(config.columns[:logo], :name => 'record[logo]', :id => 'record_logo', :object => @record)
79
76
  end
80
77
  end
78
+
79
+ protected
80
+
81
+ def document_root_element
82
+ @document.root
83
+ end
81
84
  end
@@ -28,7 +28,7 @@ class TinyMceTest < ActionView::TestCase
28
28
  def test_includes
29
29
  ActiveScaffold::Bridges::TinyMce.expects(:install?).returns(true)
30
30
  with_js_framework :jquery do
31
- assert ActiveScaffold::Bridges.all_javascripts.include?('tinymce-jquery')
31
+ assert ActiveScaffold::Bridges.all_javascripts.include?('tinymce')
32
32
  end
33
33
  end
34
34
 
@@ -1,7 +1,7 @@
1
1
  require 'test_helper'
2
2
 
3
3
  module Config
4
- class BaseTest < MiniTest::Test
4
+ class BaseTest < Minitest::Test
5
5
  def setup
6
6
  @base = ActiveScaffold::Config::Base.new(ActiveScaffold::Config::Core.new(:model_stub))
7
7
  end
@@ -1,7 +1,7 @@
1
1
  require 'test_helper'
2
2
 
3
3
  module Config
4
- class CoreTest < MiniTest::Test
4
+ class CoreTest < Minitest::Test
5
5
  class ModelStubsController < ActionController::Base
6
6
  include ActiveScaffold::Core
7
7
  end
@@ -1,7 +1,7 @@
1
1
  require 'test_helper'
2
2
 
3
3
  module Config
4
- class CreateTest < MiniTest::Test
4
+ class CreateTest < Minitest::Test
5
5
  include ActiveScaffold::Helpers::ControllerHelpers
6
6
 
7
7
  def setup
@@ -1,7 +1,7 @@
1
1
  require 'test_helper'
2
2
 
3
3
  module Config
4
- class DeleteTest < MiniTest::Test
4
+ class DeleteTest < Minitest::Test
5
5
  def setup
6
6
  @config = ActiveScaffold::Config::Core.new :model_stub
7
7
  @default_link = @config.delete.link
@@ -1,7 +1,7 @@
1
1
  require 'test_helper'
2
2
 
3
3
  module Config
4
- class FieldSearchTest < MiniTest::Test
4
+ class FieldSearchTest < Minitest::Test
5
5
  def setup
6
6
  @config = ActiveScaffold::Config::Core.new :model_stub
7
7
  @config.actions.swap :search, :field_search
@@ -1,7 +1,7 @@
1
1
  require 'test_helper'
2
2
 
3
3
  module Config
4
- class ListTest < MiniTest::Test
4
+ class ListTest < Minitest::Test
5
5
  def setup
6
6
  @config = ActiveScaffold::Config::Core.new :model_stub
7
7
  end
@@ -1,7 +1,7 @@
1
1
  require 'test_helper'
2
2
 
3
3
  module Config
4
- class NestedTest < MiniTest::Test
4
+ class NestedTest < Minitest::Test
5
5
  class ModelStubsController < ActionController::Base
6
6
  include ActiveScaffold::Core
7
7
  active_scaffold
@@ -1,7 +1,7 @@
1
1
  require 'test_helper'
2
2
 
3
3
  module Config
4
- class SearchTest < MiniTest::Test
4
+ class SearchTest < Minitest::Test
5
5
  def setup
6
6
  @config = ActiveScaffold::Config::Core.new :model_stub
7
7
  @default_link = @config.search.link
@@ -1,7 +1,7 @@
1
1
  require 'test_helper'
2
2
 
3
3
  module Config
4
- class ShowTest < MiniTest::Test
4
+ class ShowTest < Minitest::Test
5
5
  def setup
6
6
  @config = ActiveScaffold::Config::Core.new :model_stub
7
7
  @default_link = @config.show.link
@@ -1,7 +1,7 @@
1
1
  require 'test_helper'
2
2
 
3
3
  module Config
4
- class SubformTest < MiniTest::Test
4
+ class SubformTest < Minitest::Test
5
5
  def setup
6
6
  @config = ActiveScaffold::Config::Core.new :model_stub
7
7
  end
@@ -1,7 +1,7 @@
1
1
  require 'test_helper'
2
2
 
3
3
  module Config
4
- class UpdateTest < MiniTest::Test
4
+ class UpdateTest < Minitest::Test
5
5
  include ActiveScaffold::Helpers::ControllerHelpers
6
6
 
7
7
  def setup
@@ -2,7 +2,7 @@ require 'test_helper'
2
2
  # require 'test/model_stub'
3
3
  # require File.join(File.dirname(__FILE__), '../../lib/active_scaffold/data_structures/set.rb')
4
4
 
5
- class ActionColumnsTest < MiniTest::Test
5
+ class ActionColumnsTest < Minitest::Test
6
6
  def setup
7
7
  @columns = ActiveScaffold::DataStructures::ActionColumns.new(%i[a b])
8
8
  @columns.action = stub(core: stub(model_id: 'model_stub'), user_settings_key: :"model_stub_active_scaffold/config/test")
@@ -1,6 +1,6 @@
1
1
  require 'test_helper'
2
2
 
3
- class ActionLinkTest < MiniTest::Test
3
+ class ActionLinkTest < Minitest::Test
4
4
  def setup
5
5
  @link = ActiveScaffold::DataStructures::ActionLink.new('foo')
6
6
  end
@@ -1,6 +1,6 @@
1
1
  require 'test_helper'
2
2
 
3
- class ActionLinksTest < MiniTest::Test
3
+ class ActionLinksTest < Minitest::Test
4
4
  def setup
5
5
  @links = ActiveScaffold::DataStructures::ActionLinks.new
6
6
  end
@@ -1,6 +1,6 @@
1
1
  require 'test_helper'
2
2
 
3
- class ActionsTest < MiniTest::Test
3
+ class ActionsTest < Minitest::Test
4
4
  def setup
5
5
  @actions = ActiveScaffold::DataStructures::Actions.new(:a, 'b')
6
6
  end
@@ -1,7 +1,7 @@
1
1
  require 'test_helper'
2
2
  require 'model_stub'
3
3
 
4
- class AssociationColumnTest < MiniTest::Test
4
+ class AssociationColumnTest < Minitest::Test
5
5
  def setup
6
6
  @association_column = ActiveScaffold::DataStructures::Column.new('other_model', ModelStub)
7
7
  end
@@ -1,6 +1,6 @@
1
1
  require 'test_helper'
2
2
 
3
- class ColumnTest < MiniTest::Test
3
+ class ColumnTest < Minitest::Test
4
4
  def setup
5
5
  @column = ActiveScaffold::DataStructures::Column.new(:a, ModelStub)
6
6
  @association_col = ActiveScaffold::DataStructures::Column.new(:b, ModelStub)
@@ -1,6 +1,6 @@
1
1
  require 'test_helper'
2
2
 
3
- class ColumnsTest < MiniTest::Test
3
+ class ColumnsTest < Minitest::Test
4
4
  def setup
5
5
  @columns = ActiveScaffold::DataStructures::Columns.new(ModelStub, :a, :b)
6
6
  end
@@ -1,6 +1,6 @@
1
1
  require 'test_helper'
2
2
 
3
- class SetTest < MiniTest::Test
3
+ class SetTest < Minitest::Test
4
4
  def setup
5
5
  @items = ActiveScaffold::DataStructures::Set.new(:a, :b)
6
6
  end
@@ -1,6 +1,6 @@
1
1
  require 'test_helper'
2
2
 
3
- class SortingTest < MiniTest::Test
3
+ class SortingTest < Minitest::Test
4
4
  def setup
5
5
  @columns = ActiveScaffold::DataStructures::Columns.new(ModelStub, :a, :b, :c, :d, :id)
6
6
  @sorting = ActiveScaffold::DataStructures::Sorting.new(@columns, ModelStub)
@@ -1,6 +1,6 @@
1
1
  require 'test_helper'
2
2
 
3
- class StandardColumnTest < MiniTest::Test
3
+ class StandardColumnTest < Minitest::Test
4
4
  def setup
5
5
  @standard_column = ActiveScaffold::DataStructures::Column.new(ModelStub.columns.first.name, ModelStub)
6
6
  end
@@ -1,6 +1,6 @@
1
1
  require 'test_helper'
2
2
 
3
- class ValidationReflectionTest < MiniTest::Test
3
+ class ValidationReflectionTest < Minitest::Test
4
4
  def test_set_required_for_validates_presence_of
5
5
  column = ActiveScaffold::DataStructures::Column.new(:name, Company)
6
6
  refute column.required?
@@ -1,6 +1,6 @@
1
1
  require 'test_helper'
2
2
 
3
- class VirtualColumnTest < MiniTest::Test
3
+ class VirtualColumnTest < Minitest::Test
4
4
  def setup
5
5
  @virtual_column = ActiveScaffold::DataStructures::Column.new(:fake, ModelStub)
6
6
  end
@@ -1,6 +1,6 @@
1
1
  require 'test_helper'
2
2
 
3
- class ActiveRecordTest < MiniTest::Test
3
+ class ActiveRecordTest < Minitest::Test
4
4
  def setup
5
5
  @record = ModelStub.new
6
6
  end
@@ -1,6 +1,6 @@
1
1
  require 'test_helper'
2
2
 
3
- class PaginationHelpersTest < MiniTest::Test
3
+ class PaginationHelpersTest < Minitest::Test
4
4
  include ActiveScaffold::Helpers::PaginationHelpers
5
5
  include ActionView::Helpers::OutputSafetyHelper
6
6
 
@@ -81,7 +81,7 @@ class PermissionModel < ActiveRecord::Base
81
81
  # def c1_authorized_for_update?; end
82
82
  end
83
83
 
84
- class ActiveRecordPermissionsTest < MiniTest::Test
84
+ class ActiveRecordPermissionsTest < Minitest::Test
85
85
  def setup
86
86
  @model = PermissionModel.new
87
87
  end
@@ -1,6 +1,6 @@
1
1
  require 'test_helper'
2
2
 
3
- class AttributeParamsTest < MiniTest::Test
3
+ class AttributeParamsTest < Minitest::Test
4
4
  def setup
5
5
  @controller = Controller.new
6
6
  end
@@ -1,7 +1,7 @@
1
1
  require 'test_helper'
2
2
  require 'class_with_finder'
3
3
 
4
- class CalculationTest < MiniTest::Test
4
+ class CalculationTest < Minitest::Test
5
5
  def setup
6
6
  @buildings = []
7
7
  @buildings << Building.create { |b| b.build_owner(:first_name => 'foo') }
@@ -15,7 +15,7 @@ class ExtendedClass < ConfigurableClass
15
15
  extend ActiveScaffold::Configurable
16
16
  end
17
17
 
18
- class ConfigurableTest < MiniTest::Test
18
+ class ConfigurableTest < Minitest::Test
19
19
  ##
20
20
  ## constants and methods for tests to check against
21
21
  ##
@@ -121,7 +121,7 @@ class ConstraintsTestObject
121
121
  end
122
122
  end
123
123
 
124
- class ConstraintsTest < MiniTest::Test
124
+ class ConstraintsTest < Minitest::Test
125
125
  def setup
126
126
  @test_object = ConstraintsTestObject.new
127
127
  end
@@ -22,7 +22,7 @@ class NumberModel < ActiveRecord::Base
22
22
  end
23
23
  end
24
24
 
25
- class ConvertNumbersFormatTest < MiniTest::Test
25
+ class ConvertNumbersFormatTest < Minitest::Test
26
26
  include ActiveScaffoldConfigMock
27
27
  include ActiveScaffold::AttributeParams
28
28
  include ActiveScaffold::Finder
@@ -1,7 +1,7 @@
1
1
  require 'test_helper'
2
2
  require 'class_with_finder'
3
3
 
4
- class FinderTest < MiniTest::Test
4
+ class FinderTest < Minitest::Test
5
5
  def setup
6
6
  @klass = ClassWithFinder.new
7
7
  @klass.active_scaffold_config.stubs(model: ModelStub)
@@ -1,6 +1,6 @@
1
1
  require 'test_helper'
2
2
 
3
- class LocalizationTest < MiniTest::Test
3
+ class LocalizationTest < Minitest::Test
4
4
  def test_localization
5
5
  assert_equal 'Dutch', as_(:dutch)
6
6
  assert_equal 'dutch', as_('dutch')
@@ -22,7 +22,7 @@ class DateTimeModel < ActiveRecord::Base
22
22
  end
23
23
  end
24
24
 
25
- class ParseDatetimeTest < MiniTest::Test
25
+ class ParseDatetimeTest < Minitest::Test
26
26
  include ActiveScaffoldConfigMock
27
27
  include ActiveScaffold::AttributeParams
28
28
  include ActiveScaffold::Finder
@@ -1,6 +1,6 @@
1
1
  require 'test_helper'
2
2
 
3
- class TablelessTest < MiniTest::Test
3
+ class TablelessTest < Minitest::Test
4
4
  def test_find_all
5
5
  assert FileModel.all.to_a.empty?
6
6
  end
data/test/test_helper.rb CHANGED
@@ -8,7 +8,7 @@ require 'mocha/minitest'
8
8
  require 'cow_proxy'
9
9
 
10
10
  require 'minitest/reporters'
11
- Minitest::Reporters.use!
11
+ Minitest::Reporters.use! unless ENV['RM_INFO']
12
12
 
13
13
  def load_schema
14
14
  stdout = $stdout
@@ -32,10 +32,10 @@ I18n.backend.store_translations :en, YAML.load_file(File.expand_path('../config/
32
32
 
33
33
  # rails 4.0
34
34
  unless defined? Minitest::Test
35
- class Minitest::Test < MiniTest::Unit::TestCase
35
+ class Minitest::Test < Minitest::Unit::TestCase
36
36
  end
37
37
 
38
- class MiniTest::Unit::TestCase
38
+ class Minitest::Unit::TestCase
39
39
  def with_js_framework(framework)
40
40
  framework, ActiveScaffold.js_framework = ActiveScaffold.js_framework, framework
41
41
  yield
@@ -44,7 +44,7 @@ unless defined? Minitest::Test
44
44
  end
45
45
  end
46
46
 
47
- class MiniTest::Test
47
+ class Minitest::Test
48
48
  protected
49
49
 
50
50
  def with_js_framework(framework)