eac_rails_utils 0.10.1 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper.rb +5 -1
- data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper/form_builder.rb +10 -2
- data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper/form_builder/association_select_field.rb +1 -1
- data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper/form_builder/common_text_fields.rb +1 -1
- data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper/form_builder/currency_field.rb +1 -1
- data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper/form_builder/date_field.rb +1 -1
- data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper/form_builder/fields_for.rb +1 -1
- data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper/form_builder/file_field.rb +1 -1
- data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper/form_builder/radio_select_field.rb +1 -1
- data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper/form_builder/searchable_association_field.rb +1 -1
- data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper/form_builder/select_field.rb +1 -1
- data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper/form_builder/time_field.rb +1 -1
- data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper/form_builder/year_month_field.rb +1 -1
- data/app/helpers/eac_rails_utils/data_table_helper.rb +13 -0
- data/{lib/eac → app/helpers/eac_rails_utils}/data_table_helper/column.rb +1 -1
- data/{lib/eac → app/helpers/eac_rails_utils}/data_table_helper/data_table.rb +2 -2
- data/{lib/eac → app/helpers/eac_rails_utils}/data_table_helper/setup.rb +2 -2
- data/{lib/eac → app/helpers/eac_rails_utils}/menus_helper.rb +5 -1
- data/{lib/eac → app/helpers/eac_rails_utils}/menus_helper/bootstrap_gui_builder.rb +1 -1
- data/{lib/eac → app/helpers/eac_rails_utils}/menus_helper/data_builder.rb +1 -1
- data/{lib/eac → app/helpers/eac_rails_utils}/menus_helper/gui_builder.rb +1 -1
- data/{lib/eac → app/validators/eac_rails_utils}/cpf_validator.rb +1 -1
- data/{lib/eac → app/validators/eac_rails_utils}/no_presence_validator.rb +1 -1
- data/lib/eac_rails_utils.rb +2 -39
- data/lib/eac_rails_utils/engine.rb +2 -0
- data/lib/{eac → eac_rails_utils}/htmlbeautifier.rb +1 -1
- data/lib/eac_rails_utils/models.rb +9 -0
- data/lib/eac_rails_utils/models/attribute_required.rb +43 -0
- data/lib/eac_rails_utils/models/fetch_errors.rb +92 -0
- data/lib/eac_rails_utils/models/inequality_queries.rb +39 -0
- data/lib/eac_rails_utils/models/tableless.rb +97 -0
- data/lib/eac_rails_utils/models/test_utils.rb +65 -0
- data/lib/eac_rails_utils/patches.rb +9 -0
- data/lib/eac_rails_utils/patches/action_controller_base.rb +2 -0
- data/lib/eac_rails_utils/version.rb +1 -1
- data/test/dummy/app/models/user.rb +4 -0
- data/test/{lib/eac → helpers/eac_rails_utils}/common_form_helper_test.rb +2 -2
- data/test/{lib/eac → helpers/eac_rails_utils}/data_table_test_helper_test.rb +2 -2
- data/test/{app/helpers → helpers}/eac_rails_utils/formatter_helper_test.rb +0 -0
- data/test/lib/eac_rails_utils/{patches/model_attribute_required_test.rb → models/attribute_required_test.rb} +1 -0
- data/test/lib/eac_rails_utils/models/fetch_errors_test.rb +80 -0
- data/test/lib/eac_rails_utils/models/tableless_test.rb +25 -0
- data/test/{lib/eac → validators}/cpf_validator_test.rb +2 -2
- metadata +63 -64
- data/lib/eac/data_table_helper.rb +0 -13
- data/lib/eac/inequality_queries.rb +0 -37
- data/lib/eac/model.rb +0 -90
- data/lib/eac/test_utils.rb +0 -61
- data/lib/eac_rails_utils/patches/model_attribute_required.rb +0 -34
- data/lib/eac_rails_utils/patches/ofx_parser.rb +0 -43
- data/lib/eac_rails_utils/tableless_model.rb +0 -92
- data/test/lib/eac/model_test.rb +0 -78
- data/test/lib/eac/source_target_fixtures_test_files/a.source.html +0 -1
- data/test/lib/eac/source_target_fixtures_test_files/a.target.yaml +0 -1
- data/test/lib/eac/source_target_fixtures_test_files/b.source.html +0 -1
- data/test/lib/eac/source_target_fixtures_test_files/c.target.yaml +0 -1
- data/test/lib/eac_rails_utils/tableless_model_test.rb +0 -23
@@ -1 +0,0 @@
|
|
1
|
-
|
@@ -1 +0,0 @@
|
|
1
|
-
|
@@ -1 +0,0 @@
|
|
1
|
-
|
@@ -1 +0,0 @@
|
|
1
|
-
|
@@ -1,23 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'test_helper'
|
4
|
-
|
5
|
-
module EacRailsUtils
|
6
|
-
class TablelessModelTest < ActiveSupport::TestCase
|
7
|
-
class Stub < ::EacRailsUtils::TablelessModel
|
8
|
-
attribute :tempo, DateTime
|
9
|
-
end
|
10
|
-
|
11
|
-
test 'date time array values' do
|
12
|
-
stub = Stub.new('tempo(1i)' => '9', 'tempo(2i)' => '10', 'tempo(3i)' => '11',
|
13
|
-
'tempo(4i)' => '12', 'tempo(5i)' => '13', 'tempo(6i)' => '14')
|
14
|
-
assert stub.tempo.is_a?(DateTime), "Class: |#{stub.tempo.class}|, Value: |#{stub.tempo}|"
|
15
|
-
assert_equal 9, stub.tempo.year, 'Year'
|
16
|
-
assert_equal 10, stub.tempo.month, 'Month'
|
17
|
-
assert_equal 11, stub.tempo.day, 'Day'
|
18
|
-
assert_equal 12, stub.tempo.hour, 'Hour'
|
19
|
-
assert_equal 13, stub.tempo.minute, 'Minute'
|
20
|
-
assert_equal 14, stub.tempo.second, 'Second'
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|