eac_rails_utils 0.9.1 → 0.11.2

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 (60) hide show
  1. checksums.yaml +4 -4
  2. data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper.rb +5 -1
  3. data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper/form_builder.rb +10 -2
  4. data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper/form_builder/association_select_field.rb +1 -1
  5. data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper/form_builder/common_text_fields.rb +1 -1
  6. data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper/form_builder/currency_field.rb +1 -1
  7. data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper/form_builder/date_field.rb +1 -1
  8. data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper/form_builder/fields_for.rb +1 -1
  9. data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper/form_builder/file_field.rb +1 -1
  10. data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper/form_builder/radio_select_field.rb +1 -1
  11. data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper/form_builder/searchable_association_field.rb +1 -1
  12. data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper/form_builder/select_field.rb +3 -2
  13. data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper/form_builder/time_field.rb +1 -1
  14. data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper/form_builder/year_month_field.rb +1 -1
  15. data/app/helpers/eac_rails_utils/data_table_helper.rb +13 -0
  16. data/{lib/eac → app/helpers/eac_rails_utils}/data_table_helper/column.rb +1 -1
  17. data/{lib/eac → app/helpers/eac_rails_utils}/data_table_helper/data_table.rb +2 -2
  18. data/{lib/eac → app/helpers/eac_rails_utils}/data_table_helper/setup.rb +2 -2
  19. data/app/helpers/eac_rails_utils/links_helper.rb +8 -1
  20. data/{lib/eac → app/helpers/eac_rails_utils}/menus_helper.rb +5 -1
  21. data/{lib/eac → app/helpers/eac_rails_utils}/menus_helper/bootstrap_gui_builder.rb +1 -1
  22. data/{lib/eac → app/helpers/eac_rails_utils}/menus_helper/data_builder.rb +1 -1
  23. data/{lib/eac → app/helpers/eac_rails_utils}/menus_helper/gui_builder.rb +1 -1
  24. data/{lib/eac → app/validators/eac_rails_utils}/cpf_validator.rb +1 -1
  25. data/{lib/eac → app/validators/eac_rails_utils}/no_presence_validator.rb +1 -1
  26. data/lib/eac_rails_utils.rb +2 -39
  27. data/lib/eac_rails_utils/engine.rb +2 -0
  28. data/lib/{eac → eac_rails_utils}/htmlbeautifier.rb +1 -1
  29. data/lib/eac_rails_utils/models.rb +9 -0
  30. data/lib/eac_rails_utils/models/attribute_required.rb +43 -0
  31. data/lib/eac_rails_utils/models/fetch_errors.rb +92 -0
  32. data/lib/eac_rails_utils/models/inequality_queries.rb +39 -0
  33. data/lib/eac_rails_utils/models/tableless.rb +97 -0
  34. data/lib/eac_rails_utils/models/test_utils.rb +65 -0
  35. data/lib/eac_rails_utils/patches.rb +9 -0
  36. data/lib/eac_rails_utils/patches/action_controller_base.rb +2 -0
  37. data/lib/eac_rails_utils/patches/active_model_associations.rb +38 -0
  38. data/lib/eac_rails_utils/version.rb +1 -1
  39. data/test/dummy/app/models/user.rb +4 -0
  40. data/test/{lib/eac → helpers/eac_rails_utils}/common_form_helper_test.rb +2 -2
  41. data/test/{lib/eac → helpers/eac_rails_utils}/data_table_test_helper_test.rb +2 -2
  42. data/test/{app/helpers → helpers}/eac_rails_utils/formatter_helper_test.rb +0 -0
  43. data/test/lib/eac_rails_utils/{patches/model_attribute_required_test.rb → models/attribute_required_test.rb} +1 -0
  44. data/test/lib/eac_rails_utils/models/fetch_errors_test.rb +80 -0
  45. data/test/lib/eac_rails_utils/models/tableless_test.rb +25 -0
  46. data/test/{lib/eac → validators}/cpf_validator_test.rb +2 -2
  47. metadata +66 -72
  48. data/lib/eac/data_table_helper.rb +0 -13
  49. data/lib/eac/inequality_queries.rb +0 -37
  50. data/lib/eac/model.rb +0 -90
  51. data/lib/eac/test_utils.rb +0 -61
  52. data/lib/eac_rails_utils/patches/model_attribute_required.rb +0 -34
  53. data/lib/eac_rails_utils/patches/ofx_parser.rb +0 -43
  54. data/lib/eac_rails_utils/tableless_model.rb +0 -92
  55. data/test/lib/eac/model_test.rb +0 -78
  56. data/test/lib/eac/source_target_fixtures_test_files/a.source.html +0 -1
  57. data/test/lib/eac/source_target_fixtures_test_files/a.target.yaml +0 -1
  58. data/test/lib/eac/source_target_fixtures_test_files/b.source.html +0 -1
  59. data/test/lib/eac/source_target_fixtures_test_files/c.target.yaml +0 -1
  60. data/test/lib/eac_rails_utils/tableless_model_test.rb +0 -23
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EacRailsUtils
4
+ module Models
5
+ # == Example:
6
+ #
7
+ # Note: model Product has a attribute "foo" Date, Time or Number:
8
+ #
9
+ # class Product
10
+ # include ::EacRailsUtils::Models::InequalityQueries
11
+ #
12
+ # add_inequality_queries(:foo)
13
+ # end
14
+ #
15
+ # This add the following scopes:
16
+ #
17
+ # Product.by_foo_gt(value) # Equivalent to Product.where("foo > ?", value)
18
+ # Product.by_foo_gteq(value) # Equivalent to Product.where("foo >= ?", value)
19
+ # Product.by_foo_lt(value) # Equivalent to Product.where("foo < ?", value)
20
+ # Product.by_foo_lteq(value) # Equivalent to Product.where("foo <= ?", value)
21
+ module InequalityQueries
22
+ class << self
23
+ def included(base)
24
+ base.extend(ClassMethods)
25
+ end
26
+ end
27
+
28
+ module ClassMethods
29
+ def add_inequality_queries(attribute)
30
+ %w[gt gteq lt lteq].each do |ineq|
31
+ scope "by_#{attribute}_#{ineq}", lambda { |v|
32
+ where(arel_table[attribute].send(ineq, v))
33
+ }
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,97 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_rails_utils/patches/active_model_associations'
4
+ require 'virtus'
5
+
6
+ module EacRailsUtils
7
+ module Models
8
+ class Tableless
9
+ include ActiveModel::Model
10
+ include Virtus.model
11
+ include ActiveModel::Associations
12
+
13
+ def initialize(values = {})
14
+ super(build_attributes(values))
15
+ end
16
+
17
+ def attributes=(values)
18
+ super(build_attributes(values))
19
+ end
20
+
21
+ # need hash like accessor, used internal Rails
22
+ def [](attr)
23
+ send(attr)
24
+ end
25
+
26
+ # need hash like accessor, used internal Rails
27
+ def []=(attr, value)
28
+ send("#{attr}=", value)
29
+ end
30
+
31
+ def save!
32
+ save || raise("#{self.class}.save failed: #{errors.messages}")
33
+ end
34
+
35
+ private
36
+
37
+ def build_attributes(values)
38
+ AttributesBuilder.new(self.class, values).to_attributes
39
+ end
40
+
41
+ class AttributesBuilder
42
+ DATE_TIME_FIELDS = %i[year month day hour min sec].freeze
43
+
44
+ def initialize(model_class, values)
45
+ @model_class = model_class
46
+ @values = {}
47
+ values.each { |k, v| add(k, v) }
48
+ end
49
+
50
+ def to_attributes
51
+ @values
52
+ end
53
+
54
+ private
55
+
56
+ def add(key, value)
57
+ array_attr = parse_array_attr_key(key)
58
+ if array_attr
59
+ array_value_set(array_attr, value)
60
+ else
61
+ @values[key] = value
62
+ end
63
+ end
64
+
65
+ def parse_array_attr_key(key)
66
+ m = /\A(.+)\(([0-9]+)(.)\)\z/.match(key)
67
+ return unless m
68
+
69
+ ::OpenStruct.new(key: m[1], index: m[2].to_i - 1, converter: array_value_converter(m[3]))
70
+ end
71
+
72
+ def array_value_set(array_attr, value)
73
+ @values[array_attr.key] ||= {}
74
+ @values[array_attr.key].merge!(
75
+ DATE_TIME_FIELDS[array_attr.index] => value.send(array_attr.converter)
76
+ )
77
+ end
78
+
79
+ def array_value_converter(str_type)
80
+ case str_type
81
+ when 'i'
82
+ 'to_i'
83
+ else
84
+ raise "Unknown array type: \"#{str_type}\""
85
+ end
86
+ end
87
+
88
+ def date_time_attribute?(key)
89
+ attr = @model_class.attributes[key]
90
+ return false unless attr
91
+
92
+ raise attr.to_s
93
+ end
94
+ end
95
+ end
96
+ end
97
+ end
@@ -0,0 +1,65 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EacRailsUtils
4
+ module Models
5
+ module TestUtils
6
+ # Add more helper methods to be used by all tests here...
7
+ def valid_invalid_column_values_test(record, column, valid_values, invalid_values)
8
+ valid_values.each do |v|
9
+ record.send("#{column}=", v)
10
+ assert record.valid?,
11
+ "#{record.errors.messages}, #{column} = #{v.inspect} should be valid"
12
+ end
13
+ invalid_values.each do |v|
14
+ record.send("#{column}=", v)
15
+ assert_not record.valid?, "#{column} = #{v.inspect} should be invalid"
16
+ end
17
+ end
18
+
19
+ # Verifica falhas em campos específicos de um record
20
+ def assert_record_errors(record, fields_without_error, fields_with_error)
21
+ fields_without_error.each do |c|
22
+ assert record.errors[c].empty?,
23
+ "Column: #{c} should not have errors (#{record.errors[c]})"
24
+ end
25
+ fields_with_error. each do |c|
26
+ assert_not record.errors[c].empty?, "Column: #{c} should have errors"
27
+ end
28
+ end
29
+
30
+ # Verifica, campo por campo, se invalida o registro.
31
+ def assert_column_changes(ppp, expected_valid_result, changes)
32
+ changes.each do |k, v|
33
+ ppp.send("#{k}=", v)
34
+ assert_equal expected_valid_result, ppp.valid?,
35
+ "\"#{k}\" change should be " + (expected_valid_result ? 'valid' : 'invalid')
36
+ assert_not ppp.errors[k].empty? unless expected_valid_result
37
+ ppp.restore_attributes
38
+ end
39
+ end
40
+
41
+ # Ex.: attrs = {a: 1, b: 2} resulta em
42
+ # [{a: nil, b: nil}, {a: 1, b: nil}, {a: nil, b: 2}, {a: 1, b: 2}].
43
+ def all_combinations(attrs)
44
+ combs = [{}]
45
+ attrs.each do |attr_name, value|
46
+ combs = all_combinations_new_combination(attr_name, value, combs)
47
+ end
48
+ combs
49
+ end
50
+
51
+ def all_combinations_new_combination(attr_name, value, combs)
52
+ new_comb = []
53
+ assert_not value.nil?, "#{attr_name}=#{value}"
54
+ [nil, value].each do |vv|
55
+ combs.each do |c|
56
+ cc = c.dup
57
+ cc[attr_name] = vv
58
+ new_comb << cc
59
+ end
60
+ end
61
+ new_comb
62
+ end
63
+ end
64
+ end
65
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/require_sub'
4
+
5
+ module EacRailsUtils
6
+ module Patches
7
+ ::EacRubyUtils.require_sub __FILE__
8
+ end
9
+ end
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'action_controller/base'
4
+
3
5
  module EacRailsUtils
4
6
  module Patches
5
7
  module ActionControllerBasePatch
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'active_model/associations/hooks'
4
+ require 'activemodel/associations'
5
+
6
+ module EacRailsUtils
7
+ module Patches
8
+ module ActiveModelAssociations
9
+ module ScopeExtensionPatch
10
+ def add_constraints(scope, owner, association_klass, *extra_args)
11
+ if extra_args.any?
12
+ refl = extra_args.first
13
+ if refl.options[:active_model]
14
+ target_ids = refl.options[:target_ids]
15
+ return scope.where(id: owner[target_ids])
16
+ end
17
+ end
18
+
19
+ super
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+
26
+ module ActiveModel
27
+ module Associations
28
+ module Hooks
29
+ def self.init
30
+ ActiveSupport.on_load(:active_record) do
31
+ ActiveRecord::Associations::AssociationScope.prepend(
32
+ ::EacRailsUtils::Patches::ActiveModelAssociations::ScopeExtensionPatch
33
+ )
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacRailsUtils
4
- VERSION = '0.9.1'
4
+ VERSION = '0.11.2'
5
5
  end
@@ -1,6 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'eac_rails_utils/models/attribute_required'
4
+
3
5
  class User < ActiveRecord::Base
6
+ include ::EacRailsUtils::Models::AttributeRequired
7
+
4
8
  belongs_to :job
5
9
 
6
10
  validates :job, presence: true
@@ -2,9 +2,9 @@
2
2
 
3
3
  require 'test_helper'
4
4
 
5
- module Eac
5
+ module EacRailsUtils
6
6
  class CommonFormHelperTest < ActionView::TestCase
7
- include Eac::CommonFormHelper
7
+ include ::EacRailsUtils::CommonFormHelper
8
8
 
9
9
  setup do
10
10
  reset_test_database
@@ -2,9 +2,9 @@
2
2
 
3
3
  require 'test_helper'
4
4
 
5
- module Eac
5
+ module EacRailsUtils
6
6
  class DataTableTestHelperTest < ActionView::TestCase
7
- include ::Eac::DataTableHelper
7
+ include ::EacRailsUtils::DataTableHelper
8
8
 
9
9
  class Person
10
10
  attr_reader :name, :age, :job
@@ -32,6 +32,7 @@ module EacRailsUtils
32
32
 
33
33
  class ActiveModelStub
34
34
  include ActiveModel::Model
35
+ include ::EacRailsUtils::Models::AttributeRequired
35
36
 
36
37
  attr_accessor :name, :age
37
38
  validates :name, presence: true
@@ -0,0 +1,80 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'test_helper'
4
+
5
+ module EacRailsUtils
6
+ module Models
7
+ class FetchErrorsTest < ActiveSupport::TestCase
8
+ class M1
9
+ include ActiveModel::Model
10
+ include EacRailsUtils::Models::FetchErrors
11
+ attr_accessor :name, :age, :account, :country_id, :other
12
+ end
13
+
14
+ class M2
15
+ include ActiveModel::Model
16
+ attr_accessor :name, :myage, :account_id, :country
17
+
18
+ validate :my_validate
19
+
20
+ def my_validate
21
+ errors.add(:name, 'NAME_ERROR')
22
+ errors.add(:myage, 'MYAGE_ERROR')
23
+ errors.add(:account_id, 'ACCOUNT_ID_ERROR')
24
+ errors.add(:country, 'COUNTRY_ERROR')
25
+ end
26
+ end
27
+
28
+ def setup
29
+ reset_m1
30
+ reset_m2
31
+ end
32
+
33
+ def test_fetch_column_errors
34
+ @m1.fetch_column_errors(@m2, :myage, :age)
35
+ assert_equal @m2.errors[:myage], @m1.errors[:age]
36
+ end
37
+
38
+ def test_fetch_record_errors
39
+ @m1.fetch_record_errors(@m2)
40
+ { name: :name, account_id: :account, country: :country_id }.each do |c2, c1|
41
+ assert_equal @m2.errors[c2], @m1.errors[c1], "c2: #{c2}, c1: #{c1}"
42
+ end
43
+ assert @m1.errors[:age].empty?
44
+ end
45
+
46
+ def test_fetch_record_errors_with_default_column
47
+ @m1.fetch_record_errors(@m2, default_column: :other)
48
+ assert_equal @m2.errors[:name], @m1.errors[:name]
49
+ assert @m1.errors[:age].empty?
50
+ assert_equal ['Myage: MYAGE_ERROR'], @m1.errors[:other]
51
+ end
52
+
53
+ def test_fetch_record_errors_with_skip_option
54
+ @m1.fetch_record_errors(@m2, skip: [:name])
55
+ assert @m1.errors[:name].empty?
56
+ assert @m1.errors[:age].empty?
57
+ end
58
+
59
+ def test_fetch_record_errors_by_mapping
60
+ @m1.fetch_record_errors_by_mapping(@m2, name: :name, myage: :age)
61
+ assert_equal @m2.errors[:name], @m1.errors[:name]
62
+ assert_equal @m2.errors[:myage], @m1.errors[:age]
63
+ end
64
+
65
+ private
66
+
67
+ def reset_m1
68
+ @m1 = M1.new
69
+ assert @m1.errors.empty?
70
+ end
71
+
72
+ def reset_m2
73
+ @m2 = M2.new
74
+ assert_not @m2.valid?
75
+ assert_not @m2.errors[:name].empty?
76
+ assert_not @m2.errors[:myage].empty?
77
+ end
78
+ end
79
+ end
80
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'test_helper'
4
+
5
+ module EacRailsUtils
6
+ module Models
7
+ class TablelessTest < ActiveSupport::TestCase
8
+ class Stub < ::EacRailsUtils::Models::Tableless
9
+ attribute :tempo, DateTime
10
+ end
11
+
12
+ test 'date time array values' do
13
+ stub = Stub.new('tempo(1i)' => '9', 'tempo(2i)' => '10', 'tempo(3i)' => '11',
14
+ 'tempo(4i)' => '12', 'tempo(5i)' => '13', 'tempo(6i)' => '14')
15
+ assert stub.tempo.is_a?(DateTime), "Class: |#{stub.tempo.class}|, Value: |#{stub.tempo}|"
16
+ assert_equal 9, stub.tempo.year, 'Year'
17
+ assert_equal 10, stub.tempo.month, 'Month'
18
+ assert_equal 11, stub.tempo.day, 'Day'
19
+ assert_equal 12, stub.tempo.hour, 'Hour'
20
+ assert_equal 13, stub.tempo.minute, 'Minute'
21
+ assert_equal 14, stub.tempo.second, 'Second'
22
+ end
23
+ end
24
+ end
25
+ end
@@ -2,14 +2,14 @@
2
2
 
3
3
  require 'test_helper'
4
4
 
5
- module Eac
5
+ module EacRailsUtils
6
6
  class CpfValidatorTest < ActiveSupport::TestCase
7
7
  class M1
8
8
  include ActiveModel::Model
9
9
 
10
10
  attr_accessor :cpf
11
11
 
12
- validates :cpf, 'eac/cpf' => true, allow_nil: true
12
+ validates :cpf, 'eac_rails_utils/cpf' => true, allow_nil: true
13
13
  end
14
14
 
15
15
  def setup
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eac_rails_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.11.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - E.A.C.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-22 00:00:00.000000000 Z
11
+ date: 2020-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel-associations
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.1.2
19
+ version: '0.2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.1.2
26
+ version: '0.2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bootstrap-sass
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -39,53 +39,53 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: 3.3.6
41
41
  - !ruby/object:Gem::Dependency
42
- name: htmlbeautifier
42
+ name: eac_ruby_utils
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '0.33'
45
48
  - - ">="
46
49
  - !ruby/object:Gem::Version
47
- version: 1.1.1
50
+ version: 0.33.1
48
51
  type: :runtime
49
52
  prerelease: false
50
53
  version_requirements: !ruby/object:Gem::Requirement
51
54
  requirements:
55
+ - - "~>"
56
+ - !ruby/object:Gem::Version
57
+ version: '0.33'
52
58
  - - ">="
53
59
  - !ruby/object:Gem::Version
54
- version: 1.1.1
60
+ version: 0.33.1
55
61
  - !ruby/object:Gem::Dependency
56
- name: ofx-parser
62
+ name: htmlbeautifier
57
63
  requirement: !ruby/object:Gem::Requirement
58
64
  requirements:
59
65
  - - ">="
60
66
  - !ruby/object:Gem::Version
61
- version: 1.1.0
67
+ version: 1.1.1
62
68
  type: :runtime
63
69
  prerelease: false
64
70
  version_requirements: !ruby/object:Gem::Requirement
65
71
  requirements:
66
72
  - - ">="
67
73
  - !ruby/object:Gem::Version
68
- version: 1.1.0
74
+ version: 1.1.1
69
75
  - !ruby/object:Gem::Dependency
70
76
  name: rails
71
77
  requirement: !ruby/object:Gem::Requirement
72
78
  requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: '4.2'
76
79
  - - ">="
77
80
  - !ruby/object:Gem::Version
78
- version: 4.2.1
81
+ version: 4.2.11.1
79
82
  type: :runtime
80
83
  prerelease: false
81
84
  version_requirements: !ruby/object:Gem::Requirement
82
85
  requirements:
83
- - - "~>"
84
- - !ruby/object:Gem::Version
85
- version: '4.2'
86
86
  - - ">="
87
87
  - !ruby/object:Gem::Version
88
- version: 4.2.1
88
+ version: 4.2.11.1
89
89
  - !ruby/object:Gem::Dependency
90
90
  name: virtus
91
91
  requirement: !ruby/object:Gem::Requirement
@@ -149,9 +149,32 @@ extensions: []
149
149
  extra_rdoc_files: []
150
150
  files:
151
151
  - Rakefile
152
+ - app/helpers/eac_rails_utils/common_form_helper.rb
153
+ - app/helpers/eac_rails_utils/common_form_helper/form_builder.rb
154
+ - app/helpers/eac_rails_utils/common_form_helper/form_builder/association_select_field.rb
155
+ - app/helpers/eac_rails_utils/common_form_helper/form_builder/common_text_fields.rb
156
+ - app/helpers/eac_rails_utils/common_form_helper/form_builder/currency_field.rb
157
+ - app/helpers/eac_rails_utils/common_form_helper/form_builder/date_field.rb
158
+ - app/helpers/eac_rails_utils/common_form_helper/form_builder/fields_for.rb
159
+ - app/helpers/eac_rails_utils/common_form_helper/form_builder/file_field.rb
160
+ - app/helpers/eac_rails_utils/common_form_helper/form_builder/radio_select_field.rb
161
+ - app/helpers/eac_rails_utils/common_form_helper/form_builder/searchable_association_field.rb
162
+ - app/helpers/eac_rails_utils/common_form_helper/form_builder/select_field.rb
163
+ - app/helpers/eac_rails_utils/common_form_helper/form_builder/time_field.rb
164
+ - app/helpers/eac_rails_utils/common_form_helper/form_builder/year_month_field.rb
165
+ - app/helpers/eac_rails_utils/data_table_helper.rb
166
+ - app/helpers/eac_rails_utils/data_table_helper/column.rb
167
+ - app/helpers/eac_rails_utils/data_table_helper/data_table.rb
168
+ - app/helpers/eac_rails_utils/data_table_helper/setup.rb
152
169
  - app/helpers/eac_rails_utils/formatter_helper.rb
153
170
  - app/helpers/eac_rails_utils/links_helper.rb
171
+ - app/helpers/eac_rails_utils/menus_helper.rb
172
+ - app/helpers/eac_rails_utils/menus_helper/bootstrap_gui_builder.rb
173
+ - app/helpers/eac_rails_utils/menus_helper/data_builder.rb
174
+ - app/helpers/eac_rails_utils/menus_helper/gui_builder.rb
154
175
  - app/helpers/eac_rails_utils/open_graph_protocol_helper.rb
176
+ - app/validators/eac_rails_utils/cpf_validator.rb
177
+ - app/validators/eac_rails_utils/no_presence_validator.rb
155
178
  - lib/assets/javascripts/currency_field.js
156
179
  - lib/assets/javascripts/eac_rails_utils.js
157
180
  - lib/assets/javascripts/input_searchable.js
@@ -163,41 +186,19 @@ files:
163
186
  - lib/assets/stylesheets/eac_rails_utils.scss
164
187
  - lib/assets/stylesheets/jmenu.scss
165
188
  - lib/assets/stylesheets/jquery.dataTables.min.css
166
- - lib/eac/common_form_helper.rb
167
- - lib/eac/common_form_helper/form_builder.rb
168
- - lib/eac/common_form_helper/form_builder/association_select_field.rb
169
- - lib/eac/common_form_helper/form_builder/common_text_fields.rb
170
- - lib/eac/common_form_helper/form_builder/currency_field.rb
171
- - lib/eac/common_form_helper/form_builder/date_field.rb
172
- - lib/eac/common_form_helper/form_builder/fields_for.rb
173
- - lib/eac/common_form_helper/form_builder/file_field.rb
174
- - lib/eac/common_form_helper/form_builder/radio_select_field.rb
175
- - lib/eac/common_form_helper/form_builder/searchable_association_field.rb
176
- - lib/eac/common_form_helper/form_builder/select_field.rb
177
- - lib/eac/common_form_helper/form_builder/time_field.rb
178
- - lib/eac/common_form_helper/form_builder/year_month_field.rb
179
- - lib/eac/cpf_validator.rb
180
- - lib/eac/data_table_helper.rb
181
- - lib/eac/data_table_helper/column.rb
182
- - lib/eac/data_table_helper/data_table.rb
183
- - lib/eac/data_table_helper/setup.rb
184
- - lib/eac/htmlbeautifier.rb
185
- - lib/eac/inequality_queries.rb
186
- - lib/eac/menus_helper.rb
187
- - lib/eac/menus_helper/bootstrap_gui_builder.rb
188
- - lib/eac/menus_helper/data_builder.rb
189
- - lib/eac/menus_helper/gui_builder.rb
190
- - lib/eac/model.rb
191
- - lib/eac/no_presence_validator.rb
192
- - lib/eac/test_utils.rb
193
189
  - lib/eac_rails_utils.rb
194
190
  - lib/eac_rails_utils/engine.rb
191
+ - lib/eac_rails_utils/htmlbeautifier.rb
192
+ - lib/eac_rails_utils/models.rb
193
+ - lib/eac_rails_utils/models/attribute_required.rb
194
+ - lib/eac_rails_utils/models/fetch_errors.rb
195
+ - lib/eac_rails_utils/models/inequality_queries.rb
196
+ - lib/eac_rails_utils/models/tableless.rb
197
+ - lib/eac_rails_utils/models/test_utils.rb
198
+ - lib/eac_rails_utils/patches.rb
195
199
  - lib/eac_rails_utils/patches/action_controller_base.rb
196
- - lib/eac_rails_utils/patches/model_attribute_required.rb
197
- - lib/eac_rails_utils/patches/ofx_parser.rb
198
- - lib/eac_rails_utils/tableless_model.rb
200
+ - lib/eac_rails_utils/patches/active_model_associations.rb
199
201
  - lib/eac_rails_utils/version.rb
200
- - test/app/helpers/eac_rails_utils/formatter_helper_test.rb
201
202
  - test/dummy/Rakefile
202
203
  - test/dummy/app/models/job.rb
203
204
  - test/dummy/app/models/user.rb
@@ -214,17 +215,14 @@ files:
214
215
  - test/dummy/db/migrate/20160415143123_create_jobs.rb
215
216
  - test/dummy/db/migrate/20160415143229_add_job_to_users.rb
216
217
  - test/dummy/db/schema.rb
217
- - test/lib/eac/common_form_helper_test.rb
218
- - test/lib/eac/cpf_validator_test.rb
219
- - test/lib/eac/data_table_test_helper_test.rb
220
- - test/lib/eac/model_test.rb
221
- - test/lib/eac/source_target_fixtures_test_files/a.source.html
222
- - test/lib/eac/source_target_fixtures_test_files/a.target.yaml
223
- - test/lib/eac/source_target_fixtures_test_files/b.source.html
224
- - test/lib/eac/source_target_fixtures_test_files/c.target.yaml
225
- - test/lib/eac_rails_utils/patches/model_attribute_required_test.rb
226
- - test/lib/eac_rails_utils/tableless_model_test.rb
218
+ - test/helpers/eac_rails_utils/common_form_helper_test.rb
219
+ - test/helpers/eac_rails_utils/data_table_test_helper_test.rb
220
+ - test/helpers/eac_rails_utils/formatter_helper_test.rb
221
+ - test/lib/eac_rails_utils/models/attribute_required_test.rb
222
+ - test/lib/eac_rails_utils/models/fetch_errors_test.rb
223
+ - test/lib/eac_rails_utils/models/tableless_test.rb
227
224
  - test/test_helper.rb
225
+ - test/validators/cpf_validator_test.rb
228
226
  homepage:
229
227
  licenses: []
230
228
  metadata: {}
@@ -266,14 +264,10 @@ test_files:
266
264
  - test/dummy/app/models/job.rb
267
265
  - test/dummy/app/models/user.rb
268
266
  - test/test_helper.rb
269
- - test/app/helpers/eac_rails_utils/formatter_helper_test.rb
270
- - test/lib/eac_rails_utils/patches/model_attribute_required_test.rb
271
- - test/lib/eac_rails_utils/tableless_model_test.rb
272
- - test/lib/eac/common_form_helper_test.rb
273
- - test/lib/eac/data_table_test_helper_test.rb
274
- - test/lib/eac/cpf_validator_test.rb
275
- - test/lib/eac/source_target_fixtures_test_files/c.target.yaml
276
- - test/lib/eac/source_target_fixtures_test_files/b.source.html
277
- - test/lib/eac/source_target_fixtures_test_files/a.target.yaml
278
- - test/lib/eac/source_target_fixtures_test_files/a.source.html
279
- - test/lib/eac/model_test.rb
267
+ - test/validators/cpf_validator_test.rb
268
+ - test/helpers/eac_rails_utils/common_form_helper_test.rb
269
+ - test/helpers/eac_rails_utils/data_table_test_helper_test.rb
270
+ - test/helpers/eac_rails_utils/formatter_helper_test.rb
271
+ - test/lib/eac_rails_utils/models/attribute_required_test.rb
272
+ - test/lib/eac_rails_utils/models/tableless_test.rb
273
+ - test/lib/eac_rails_utils/models/fetch_errors_test.rb