effective_developer 0.8.2 → 0.8.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/effective_developer/version.rb +1 -1
- data/lib/generators/effective/ability_generator.rb +5 -3
- data/lib/scaffolds/admin_effective/views/_form.html.haml +1 -1
- data/lib/scaffolds/basic/views/_form.html.haml +1 -1
- data/lib/scaffolds/effective/views/_form.html.haml +1 -1
- data/lib/tasks/pg_pull.rake +12 -12
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 39fe3d6e71379807005ff5d46cf33e48e737b77d87e955bddaf6e6553453594a
|
4
|
+
data.tar.gz: 11dac114ce2e61603fc215c05ae40ecd232ed9d3d12e1d69c5f7764e60cdb336
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 47dc5389da4b549cd036456bdde5a08e9312077df43fbc7903c2e3c9dd916b9d013c4bd2434b317e82098a08e72aa5fca569d52adab7e0ff3ada2b4ed5e3949b
|
7
|
+
data.tar.gz: 3cd87bac6fb08a62e32e798e9e2ed1db0e6f8bf727033b2c1103529f15c1bd7962826185363e65dc68c969969d21093b0a44fc31b989f7110e1daf10815e1aac
|
@@ -53,9 +53,11 @@ module Effective
|
|
53
53
|
abilities += non_crud_actions
|
54
54
|
end
|
55
55
|
|
56
|
-
abilities = ['
|
56
|
+
abilities = ['crud'] if abilities.blank? || abilities == (crud_actions - ['show'])
|
57
57
|
|
58
|
-
if abilities
|
58
|
+
if abilities == ['crud']
|
59
|
+
abilities = "#{abilities.first}"
|
60
|
+
elsif abilities.length == 1
|
59
61
|
abilities = ":#{abilities.first}"
|
60
62
|
else
|
61
63
|
abilities = '[' + abilities.map { |action| ':' + action }.join(', ') + ']'
|
@@ -67,7 +69,7 @@ module Effective
|
|
67
69
|
resource.class_name
|
68
70
|
end
|
69
71
|
|
70
|
-
"can
|
72
|
+
"can(#{abilities}, #{name})"
|
71
73
|
)
|
72
74
|
end
|
73
75
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
= tabs do
|
2
|
-
= tab
|
2
|
+
= tab(<%= resource.name %>) do
|
3
3
|
= render '<%= resource.view_file_path("form_#{resource.name}").sub('effective/', '') %>', <%= resource.name %>: <%= resource.name %>
|
4
4
|
|
5
5
|
<%- if resource.nested_resources.present? || resource.instance.respond_to?(:logs_datatable) %>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
= tabs do
|
2
|
-
= tab
|
2
|
+
= tab(<%= resource.name %>) do
|
3
3
|
= render '<%= resource.view_file_path("form_#{resource.name}") %>', <%= resource.name %>: <%= resource.name %>
|
4
4
|
|
5
5
|
<%- if resource.nested_resources.present? || resource.instance.respond_to?(:logs_datatable) %>
|
data/lib/tasks/pg_pull.rake
CHANGED
@@ -14,10 +14,10 @@ namespace :pg do
|
|
14
14
|
# DATABASE=example bundle exec rake pg:load
|
15
15
|
desc 'Creates a new backup on remote server and downloads it to latest.dump'
|
16
16
|
task :pull, [:remote] => :environment do |t, args|
|
17
|
-
defaults = { database: nil, filename: (ENV['DATABASE'] || 'latest') + '.dump', logs: 'false' }
|
18
|
-
env_keys = { database: ENV['DATABASE'], filename: ENV['FILENAME'], logs: ENV['LOGS']
|
17
|
+
defaults = { database: nil, filename: (ENV['DATABASE'] || 'latest') + '.dump', logs: 'false' }.compact
|
18
|
+
env_keys = { database: ENV['DATABASE'], filename: ENV['FILENAME'], logs: ENV['LOGS'] }.compact
|
19
19
|
keywords = ARGV.map { |a| a.split('=') if a.include?('=') }.compact.inject({}) { |h, (k, v)| h[k.to_sym] = v; h }
|
20
|
-
args.with_defaults(defaults.
|
20
|
+
args.with_defaults(defaults.merge(env_keys).merge(keywords))
|
21
21
|
|
22
22
|
# Validate Config
|
23
23
|
configs = ActiveRecord::Base.configurations.configs_for(env_name: Rails.env)
|
@@ -42,7 +42,7 @@ namespace :pg do
|
|
42
42
|
end
|
43
43
|
|
44
44
|
# Download it to local
|
45
|
-
unless system("curl -o #{args.filename} `heroku pg:backups:
|
45
|
+
unless system("curl -o #{args.filename} `heroku pg:backups:url --remote #{args.remote}`")
|
46
46
|
abort("Error downloading database")
|
47
47
|
end
|
48
48
|
|
@@ -93,10 +93,10 @@ namespace :pg do
|
|
93
93
|
# DATABASE=example bundle exec rake pg:load
|
94
94
|
desc 'Loads a postgresql .dump file into the development database (latest.dump by default)'
|
95
95
|
task :load, [:filename] => :environment do |t, args|
|
96
|
-
defaults = { database: nil, filename: (ENV['DATABASE'] || 'latest') + '.dump' }
|
97
|
-
env_keys = { database: ENV['DATABASE'], filename: ENV['FILENAME'] }
|
96
|
+
defaults = { database: nil, filename: (ENV['DATABASE'] || 'latest') + '.dump' }.compact
|
97
|
+
env_keys = { database: ENV['DATABASE'], filename: ENV['FILENAME'] }.compact
|
98
98
|
keywords = ARGV.map { |a| a.split('=') if a.include?('=') }.compact.inject({}) { |h, (k, v)| h[k.to_sym] = v; h }
|
99
|
-
args.with_defaults(defaults.
|
99
|
+
args.with_defaults(defaults.merge(env_keys).merge(keywords))
|
100
100
|
|
101
101
|
# Validate filename
|
102
102
|
unless File.exist?(Rails.root + args.filename)
|
@@ -143,10 +143,10 @@ namespace :pg do
|
|
143
143
|
# bundle exec rake pg:save[something.dump] => Will dump the database to something.dump
|
144
144
|
desc 'Saves the development database to a postgresql .dump file (latest.dump by default)'
|
145
145
|
task :save, [:filename] => :environment do |t, args|
|
146
|
-
defaults = { database: nil, filename: (ENV['DATABASE'] || 'latest') + '.dump', logs: 'false' }
|
147
|
-
env_keys = { database: ENV['DATABASE'], filename: ENV['FILENAME'], logs: ENV['LOGS']
|
146
|
+
defaults = { database: nil, filename: (ENV['DATABASE'] || 'latest') + '.dump', logs: 'false' }.compact
|
147
|
+
env_keys = { database: ENV['DATABASE'], filename: ENV['FILENAME'], logs: ENV['LOGS'] }.compact
|
148
148
|
keywords = ARGV.map { |a| a.split('=') if a.include?('=') }.compact.inject({}) { |h, (k, v)| h[k.to_sym] = v; h }
|
149
|
-
args.with_defaults(defaults.
|
149
|
+
args.with_defaults(defaults.merge(env_keys).merge(keywords))
|
150
150
|
|
151
151
|
db = if ENV['DATABASE_URL'].to_s.length > 0 && args.database.blank?
|
152
152
|
uri = URI.parse(ENV['DATABASE_URL']) rescue nil
|
@@ -210,10 +210,10 @@ namespace :pg do
|
|
210
210
|
abort "Error capturing heroku backup"
|
211
211
|
end
|
212
212
|
|
213
|
-
url = (`heroku pg:backups:
|
213
|
+
url = (`heroku pg:backups:url --app #{args.source}`).chomp
|
214
214
|
|
215
215
|
unless (url || '').length > 0
|
216
|
-
abort "Error reading
|
216
|
+
abort "Error reading url from app #{args.source}"
|
217
217
|
end
|
218
218
|
|
219
219
|
unless system("heroku pg:backups:restore '#{url}' DATABASE_URL --app #{args.target}")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_developer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|