eac_rails_utils 0.11.4 → 0.11.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 07d2a7ca43c5129fbcb1bc6e6e1359583dfde2e49fd98ee7e13e643121e19638
4
- data.tar.gz: 3157833b02da72112a981c2cd526a7d102fff2fb55c6b567fbae4645365bd523
3
+ metadata.gz: 5e74de3cf5f5df2ebc5dbf47d99ccf3adb446b60debbc0ae0ba4bdc0341b0702
4
+ data.tar.gz: 1fc1a3c6b2f1e28cca60ee396a69dcd682e739390c321c3b0ca6a4bb74aa19a0
5
5
  SHA512:
6
- metadata.gz: e7c6dd756b2569913fafee714f74c77b51d6d2f7e7814a234c9c60aec4b53d5c2a720a5844677a1012e8765a3d5b8e769e946088766a99a75a2cccf3c21884ad
7
- data.tar.gz: 6ed6ec289d5c4bb3b9c01d732323ad4d0c9901e97c59904f552b1a052ddec63593c3be60c78374c44c4e94251e37e91c7212979369c09560981afd1e73730355
6
+ metadata.gz: f2227dab9cbab9704b6a227a29873c2d9db7de472cbe78e0546728ca171dff4b6e9af70b412b984ccfbf5c608bb501d03ba9ee23ac796877bf5759cd71bf542d
7
+ data.tar.gz: bc70bf917704e2c28f0d2a0fedeacdee1d09e48384f1ffd8fd5ed180b6d24ff77f1257c2081ea449999236c0a9a2c862e4f2897cc56904e036798489b6116476
@@ -1,10 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'eac_ruby_utils/require_sub'
3
+ require 'action_view/helpers/form_helper'
4
+ require 'eac_ruby_utils/core_ext'
4
5
 
5
6
  module EacRailsUtils
6
7
  module CommonFormHelper
7
- ::EacRubyUtils.require_sub __FILE__
8
+ common_concern do
9
+ include ::ActionView::Helpers::FormHelper
10
+ end
11
+ require_sub __FILE__
8
12
 
9
13
  def common_form(model_instance, options = {}, &block)
10
14
  submit_label = options.delete(:submit_label)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacRailsUtils
4
- VERSION = '0.11.4'
4
+ VERSION = '0.11.5'
5
5
  end
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ APP_PATH = File.expand_path('../config/application', __dir__)
5
+ require_relative '../config/boot'
6
+ require 'rails/commands'
@@ -1,6 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class CreateUsers < ActiveRecord::Migration
3
+ class CreateUsers < (
4
+ Rails.version < '5.2' ? ActiveRecord::Migration : ActiveRecord::Migration[4.2]
5
+ )
4
6
  def change
5
7
  create_table :users do |t|
6
8
  t.string :name
@@ -1,6 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class CreateJobs < ActiveRecord::Migration
3
+ class CreateJobs < (
4
+ Rails.version < '5.2' ? ActiveRecord::Migration : ActiveRecord::Migration[4.2]
5
+ )
4
6
  def change
5
7
  create_table :jobs do |t|
6
8
  t.string :name
@@ -1,6 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class AddJobToUsers < ActiveRecord::Migration
3
+ class AddJobToUsers < (
4
+ Rails.version < '5.2' ? ActiveRecord::Migration : ActiveRecord::Migration[4.2]
5
+ )
4
6
  def change
5
7
  add_belongs_to :users, :job
6
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eac_rails_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.4
4
+ version: 0.11.5
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-10-03 00:00:00.000000000 Z
11
+ date: 2020-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel-associations
@@ -128,6 +128,20 @@ dependencies:
128
128
  - - "~>"
129
129
  - !ruby/object:Gem::Version
130
130
  version: '0.1'
131
+ - !ruby/object:Gem::Dependency
132
+ name: rspec-rails
133
+ requirement: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - ">="
136
+ - !ruby/object:Gem::Version
137
+ version: '0'
138
+ type: :development
139
+ prerelease: false
140
+ version_requirements: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - ">="
143
+ - !ruby/object:Gem::Version
144
+ version: '0'
131
145
  - !ruby/object:Gem::Dependency
132
146
  name: sqlite3
133
147
  requirement: !ruby/object:Gem::Requirement
@@ -205,6 +219,7 @@ files:
205
219
  - test/dummy/app/assets/config/manifest.js
206
220
  - test/dummy/app/models/job.rb
207
221
  - test/dummy/app/models/user.rb
222
+ - test/dummy/bin/rails
208
223
  - test/dummy/config.ru
209
224
  - test/dummy/config/application.rb
210
225
  - test/dummy/config/boot.rb
@@ -218,7 +233,6 @@ files:
218
233
  - test/dummy/db/migrate/20160415143123_create_jobs.rb
219
234
  - test/dummy/db/migrate/20160415143229_add_job_to_users.rb
220
235
  - test/dummy/db/schema.rb
221
- - test/helpers/eac_rails_utils/common_form_helper_test.rb
222
236
  - test/helpers/eac_rails_utils/data_table_test_helper_test.rb
223
237
  - test/helpers/eac_rails_utils/formatter_helper_test.rb
224
238
  - test/lib/eac_rails_utils/models/attribute_required_test.rb
@@ -266,9 +280,9 @@ test_files:
266
280
  - test/dummy/app/models/job.rb
267
281
  - test/dummy/app/models/user.rb
268
282
  - test/dummy/app/assets/config/manifest.js
283
+ - test/dummy/bin/rails
269
284
  - test/test_helper.rb
270
285
  - test/validators/cpf_validator_test.rb
271
- - test/helpers/eac_rails_utils/common_form_helper_test.rb
272
286
  - test/helpers/eac_rails_utils/data_table_test_helper_test.rb
273
287
  - test/helpers/eac_rails_utils/formatter_helper_test.rb
274
288
  - test/lib/eac_rails_utils/models/attribute_required_test.rb
@@ -1,33 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'test_helper'
4
-
5
- module EacRailsUtils
6
- class CommonFormHelperTest < ActionView::TestCase
7
- include ::EacRailsUtils::CommonFormHelper
8
-
9
- setup do
10
- reset_test_database
11
- end
12
-
13
- test 'test common form' do
14
- common_form(User.new) do |f|
15
- f.text_field :name
16
- f.email_field :email
17
- f.password_field :password
18
- f.searchable_association_field :job, url: search_jobs_path
19
- end
20
- end
21
-
22
- test 'fields for' do
23
- common_form(Job.new) do |f|
24
- f.text_field :name
25
- f.fields_for :users do |nf|
26
- nf.text_field :name
27
- nf.email_field :email
28
- nf.password_field :password
29
- end
30
- end
31
- end
32
- end
33
- end