eac_rails_base0 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/config/initializers/backport_pg_10_support_to_rails_4.rb +20 -17
- data/config/initializers/backtrace_silencers.rb +1 -0
- data/config/initializers/cookies_serializer.rb +1 -0
- data/config/initializers/filter_parameter_logging.rb +1 -0
- data/config/initializers/session_store.rb +1 -0
- data/config/initializers/wrap_parameters.rb +1 -0
- data/exe/eac_rails_base0_app +4 -2
- data/lib/eac_rails_base0/ability.rb +1 -0
- data/lib/eac_rails_base0/app_base/application.rb +1 -0
- data/lib/eac_rails_base0/app_generator/builder.rb +1 -0
- data/lib/eac_rails_base0/app_generator/generator.rb +1 -1
- data/lib/eac_rails_base0/app_generator/templates/app/controllers/application_controller.rb +1 -0
- data/lib/eac_rails_base0/app_generator/templates/bin/bundle +2 -1
- data/lib/eac_rails_base0/app_generator/templates/bin/rails +2 -1
- data/lib/eac_rails_base0/app_generator/templates/bin/rake +1 -0
- data/lib/eac_rails_base0/app_generator/templates/bin/setup +2 -1
- data/lib/eac_rails_base0/app_generator/templates/config/application.rb +1 -1
- data/lib/eac_rails_base0/app_generator/templates/config/boot.rb +1 -1
- data/lib/eac_rails_base0/app_generator/templates/config/environment.rb +1 -1
- data/lib/eac_rails_base0/app_generator/templates/config.ru +1 -0
- data/lib/eac_rails_base0/app_generator/templates/lib/local_plugins.rb +1 -0
- data/lib/eac_rails_base0/spec_helper/capybara.rb +1 -0
- data/lib/eac_rails_base0/spec_helper/eac_users_support.rb +1 -0
- data/lib/eac_rails_base0/spec_helper/factory_bot.rb +1 -0
- data/lib/eac_rails_base0/spec_helper.rb +1 -0
- data/lib/eac_rails_base0/version.rb +1 -1
- data/lib/generators/eac_rails_base0/abilities/abilities_generator.rb +1 -1
- data/lib/generators/eac_rails_base0/rspec/rspec_generator.rb +1 -1
- data/lib/generators/eac_rails_base0/rspec/templates/bin_rspec.rb +1 -1
- data/lib/generators/eac_rails_base0/rspec/templates/spec_rails_helper.rb +2 -1
- data/lib/generators/eac_rails_base0/rubocop/rubocop_generator.rb +1 -1
- data/lib/generators/eac_rails_base0_generator.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: d5b75b84420f91fb7b110ad7503dcfa6b1628cc2
|
4
|
+
data.tar.gz: 54d4fd33dc9e8f4c8a679570d0775ca9c879e0b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f692883bc6c66549431bcdb9f8ac04fc9051e10e62e7caadfad70160075c287134dd581b4810cbc44278fb828dccd64719d8a0cb45dfe3ca78a726bfa1c6ecd
|
7
|
+
data.tar.gz: 5a242ea3c7e6632fbb9b6a94e36c3e1705a54c903e2cb493c4098692c88aad240f67c7259713228c9789a027908857186d7fb576f1ee7572028680e9358ba4ea
|
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require 'active_record/connection_adapters/postgresql/schema_statements'
|
3
4
|
|
4
5
|
#
|
@@ -12,25 +13,27 @@ module ActiveRecord
|
|
12
13
|
module PostgreSQL
|
13
14
|
module SchemaStatements
|
14
15
|
# Resets the sequence of a table's primary key to the maximum value.
|
15
|
-
def reset_pk_sequence!(table,
|
16
|
-
unless
|
16
|
+
def reset_pk_sequence!(table, pkey = nil, sequence = nil) #:nodoc:
|
17
|
+
unless pkey && sequence
|
17
18
|
default_pk, default_sequence = pk_and_sequence_for(table)
|
18
|
-
|
19
|
+
pkey ||= default_pk
|
19
20
|
sequence ||= default_sequence
|
20
21
|
end
|
21
|
-
reset_pk_sequence_log(sequence, table,
|
22
|
-
return unless
|
23
|
-
|
22
|
+
reset_pk_sequence_log(sequence, table, pkey)
|
23
|
+
return unless pkey && sequence
|
24
|
+
|
25
|
+
reset_pk_sequence_select_value(sequence, table, pkey)
|
24
26
|
end
|
25
27
|
|
26
28
|
private
|
27
29
|
|
28
|
-
def reset_pk_sequence_max_pk(table,
|
29
|
-
select_value("SELECT MAX(#{quote_column_name
|
30
|
+
def reset_pk_sequence_max_pk(table, pkey)
|
31
|
+
select_value("SELECT MAX(#{quote_column_name pkey}) FROM #{quote_table_name(table)}")
|
30
32
|
end
|
31
33
|
|
32
34
|
def reset_pk_sequence_minvalue(max_pk, quoted_sequence)
|
33
35
|
return nil unless max_pk.nil?
|
36
|
+
|
34
37
|
if postgresql_version >= 100_000
|
35
38
|
select_value('SELECT seqmin FROM pg_sequence WHERE seqrelid = ' \
|
36
39
|
"#{quote(quoted_sequence)}::regclass")
|
@@ -39,19 +42,19 @@ module ActiveRecord
|
|
39
42
|
end
|
40
43
|
end
|
41
44
|
|
42
|
-
def reset_pk_sequence_log(sequence, table,
|
43
|
-
|
44
|
-
|
45
|
-
|
45
|
+
def reset_pk_sequence_log(sequence, table, pkey)
|
46
|
+
return unless @logger && pkey && !sequence
|
47
|
+
|
48
|
+
@logger.warn "#{table} has primary key #{pkey} with no default sequence"
|
46
49
|
end
|
47
50
|
|
48
|
-
def reset_pk_sequence_select_value(sequence, table,
|
51
|
+
def reset_pk_sequence_select_value(sequence, table, pkey)
|
49
52
|
quoted_sequence = quote_table_name(sequence)
|
50
|
-
max_pk = reset_pk_sequence_max_pk(table,
|
53
|
+
max_pk = reset_pk_sequence_max_pk(table, pkey)
|
51
54
|
minvalue = reset_pk_sequence_minvalue(max_pk, quoted_sequence)
|
52
|
-
select_value <<-
|
53
|
-
|
54
|
-
|
55
|
+
select_value <<-END_SQL, 'SCHEMA'
|
56
|
+
SELECT setval(#{quote(quoted_sequence)}, #{max_pk || minvalue}, #{max_pk ? true : false})
|
57
|
+
END_SQL
|
55
58
|
end
|
56
59
|
end
|
57
60
|
end
|
data/exe/eac_rails_base0_app
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
2
4
|
require 'pathname'
|
3
5
|
|
4
6
|
source_path = (Pathname.new(__FILE__).dirname + '../lib').expand_path
|
@@ -7,9 +9,9 @@ $LOAD_PATH << source_path
|
|
7
9
|
require 'eac_rails_base0/app_generator/generator'
|
8
10
|
|
9
11
|
if ARGV.empty?
|
10
|
-
puts
|
12
|
+
puts 'Please provide a path for the new application'
|
11
13
|
puts
|
12
|
-
puts
|
14
|
+
puts 'See --help for more info'
|
13
15
|
exit 1
|
14
16
|
elsif ['-v', '--version'].include? ARGV[0]
|
15
17
|
puts Suspenders::VERSION
|
@@ -1,9 +1,10 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# frozen_string_literal: true
|
3
|
+
|
3
4
|
require 'pathname'
|
4
5
|
|
5
6
|
# path to your application root.
|
6
|
-
APP_ROOT = Pathname.new File.expand_path('
|
7
|
+
APP_ROOT = Pathname.new File.expand_path('..', __dir__)
|
7
8
|
|
8
9
|
Dir.chdir APP_ROOT do
|
9
10
|
# This script is a starting point to setup your application.
|
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
# This file was generated by the `rails generate rspec:install` command. Conventionally, all
|
3
4
|
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
4
5
|
# The generated `.rspec` file contains `--require spec_helper` which will cause
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
ENV['RAILS_ENV'] ||= 'test'
|
3
|
-
require File.expand_path('
|
4
|
+
require File.expand_path('../config/environment', __dir__)
|
4
5
|
abort('The Rails environment is running in production mode!') if Rails.env.production?
|
5
6
|
require 'rspec/rails'
|
6
7
|
require 'eac_rails_base0/spec_helper'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eac_rails_base0
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Esquilo Azul Company
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-09-
|
11
|
+
date: 2018-09-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bootstrap-sass
|
@@ -106,14 +106,14 @@ dependencies:
|
|
106
106
|
requirements:
|
107
107
|
- - "~>"
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
version: 0.2.
|
109
|
+
version: 0.2.3
|
110
110
|
type: :runtime
|
111
111
|
prerelease: false
|
112
112
|
version_requirements: !ruby/object:Gem::Requirement
|
113
113
|
requirements:
|
114
114
|
- - "~>"
|
115
115
|
- !ruby/object:Gem::Version
|
116
|
-
version: 0.2.
|
116
|
+
version: 0.2.3
|
117
117
|
- !ruby/object:Gem::Dependency
|
118
118
|
name: factory_bot_rails
|
119
119
|
requirement: !ruby/object:Gem::Requirement
|
@@ -402,7 +402,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
402
402
|
version: '0'
|
403
403
|
requirements: []
|
404
404
|
rubyforge_project:
|
405
|
-
rubygems_version: 2.
|
405
|
+
rubygems_version: 2.6.14
|
406
406
|
signing_key:
|
407
407
|
specification_version: 4
|
408
408
|
summary: A Rails base for multiple Rails projects developed by Esquilo Azul Company.
|