jobshop 0.0.37 → 0.0.41
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/jobshop/teams/lookups_controller.rb +2 -10
- data/app/mailers/jobshop/teams_mailer.rb +3 -3
- data/app/models/jobshop/team.rb +10 -0
- data/app/views/jobshop/teams/registrations/new.html.haml +3 -2
- data/app/views/jobshop/teams_mailer/found_teams.text.erb +2 -2
- data/lib/jobshop/templates/dummy_template.rb +15 -3
- data/lib/jobshop/templates/quick_install.rb +13 -12
- data/lib/jobshop/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c86e7e67c1715d920f77caf807a4bc4e5d0d5dec
|
4
|
+
data.tar.gz: b61cde16d2ba6177ecc3bbb62d4b7e165692b92b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb5e90365faeb6483033e4c16a776e399908ba489557ed89672bad4d864c176004ed729b41adcd5626d458f7a92e1b3e5a515ac601098e3fba86e5fac27d6cf2
|
7
|
+
data.tar.gz: bed3c0155ecd9c441f018d28f119fae407067cdb01965d770479fd496070b8c328d56dcdd0ad47ee08a5a1e90c07ef3badeb9f64188950820369f6712ad757b8
|
@@ -9,17 +9,9 @@ module Jobshop
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def create
|
12
|
-
|
12
|
+
emails = params[:user][:email].split(",").map(&:strip).take(5)
|
13
13
|
|
14
|
-
|
15
|
-
.where(email: email_addresses)
|
16
|
-
.joins(:team)
|
17
|
-
.select("jobshop_users.id AS id",
|
18
|
-
"email",
|
19
|
-
"jobshop_teams.name AS team_name")
|
20
|
-
.group_by(&:email)
|
21
|
-
|
22
|
-
@lookup.each_pair do |email, teams|
|
14
|
+
Jobshop::Team.grouped_by_email(emails).each_pair do |email, teams|
|
23
15
|
Jobshop::TeamsMailer.found_teams(email, teams).deliver_later
|
24
16
|
end
|
25
17
|
|
@@ -1,10 +1,10 @@
|
|
1
1
|
module Jobshop
|
2
2
|
class TeamsMailer < ApplicationMailer
|
3
|
-
def found_teams(
|
4
|
-
@
|
3
|
+
def found_teams(user, teams)
|
4
|
+
@user = user
|
5
5
|
@teams = teams
|
6
6
|
|
7
|
-
mail(to: @email, subject: "We found your Jobshop Teams!")
|
7
|
+
mail(to: @user.email, subject: "We found your Jobshop Teams!")
|
8
8
|
end
|
9
9
|
end
|
10
10
|
end
|
data/app/models/jobshop/team.rb
CHANGED
@@ -4,6 +4,16 @@ module Jobshop
|
|
4
4
|
has_many :users, class_name: "Jobshop::User"
|
5
5
|
has_one :default_dashboard, class_name: "Jobshop::Dashboard"
|
6
6
|
|
7
|
+
scope :grouped_by_email, ->(email_addresses) {
|
8
|
+
Jobshop::User
|
9
|
+
.where(email: email_addresses)
|
10
|
+
.joins(:team)
|
11
|
+
.includes(:team)
|
12
|
+
.each_with_object({}) { |user, teams|
|
13
|
+
(teams[user.email] ||= []) << user.team
|
14
|
+
}
|
15
|
+
}
|
16
|
+
|
7
17
|
def generate_registration_token
|
8
18
|
raw, encrypted = Devise.token_generator.generate(
|
9
19
|
self.class, :registration_token)
|
@@ -22,8 +22,9 @@
|
|
22
22
|
= f.fields_for(f.object.user) do |uf|
|
23
23
|
= uf.input :email
|
24
24
|
%p
|
25
|
-
Pick a strong password
|
26
|
-
|
25
|
+
Pick a strong password. Ideally it will be longer than eight
|
26
|
+
characters, have mixed upper/lower case, and include numbers
|
27
|
+
and symbols.
|
27
28
|
= uf.input :password
|
28
29
|
= uf.input :password_confirmation
|
29
30
|
= f.button :submit, "Next »".html_safe
|
@@ -24,13 +24,25 @@ end
|
|
24
24
|
|
25
25
|
# Mailer previews don't really play nice with Engines so in the dummy app we
|
26
26
|
# create an initializer to expose them properly.
|
27
|
-
initializer "
|
28
|
-
Rails.
|
29
|
-
|
27
|
+
initializer "jobshop_expose_mailer_previews.rb", <<-INITIALIZER.strip_heredoc
|
28
|
+
if Rails.env.development? || Rails.env.test?
|
29
|
+
Rails.application.configure do
|
30
|
+
config.action_mailer.preview_path = "\#{Jobshop::Engine.root}/spec/mailers"
|
31
|
+
end
|
32
|
+
end
|
33
|
+
INITIALIZER
|
34
|
+
|
35
|
+
# This allows us to easily use the localhost hostname in development.
|
36
|
+
initializer "jobshop_tld_length.rb", <<-INITIALIZER.strip_heredoc
|
37
|
+
if Rails.env.development? || Rails.env.test?
|
38
|
+
Rails.application.configure do
|
39
|
+
config.action_dispatch.tld_length = 0
|
40
|
+
end
|
30
41
|
end
|
31
42
|
INITIALIZER
|
32
43
|
|
33
44
|
route "mount Jobshop::Engine => \"/\""
|
34
45
|
|
46
|
+
rake "db:drop:all"
|
35
47
|
rake "db:create"
|
36
48
|
rake "db:migrate"
|
@@ -1,25 +1,26 @@
|
|
1
|
-
SECRETS_YML_URI = URI.parse("https://raw.githubusercontent.com/jobshop/jobshop/master/lib/jobshop/templates/secrets.yml.erb")
|
2
|
-
|
3
1
|
require "tempfile"
|
4
2
|
require "net/http"
|
5
3
|
|
6
4
|
# Add jobshop to the application `Gemfile`.
|
7
5
|
gem "jobshop", "~> 0.0.11"
|
8
6
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
end
|
7
|
+
def template_body(uri)
|
8
|
+
uri = URI.parse(uri)
|
9
|
+
Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
|
10
|
+
http.request(Net::HTTP::Get.new(uri))
|
11
|
+
end.body
|
12
|
+
end
|
13
|
+
|
14
|
+
# The generated config/secrets.yml file uses hardcoded values for
|
15
|
+
# test/development environments. Generate secrets pragmatically.
|
16
|
+
SECRETS_YML_URI = "https://raw.githubusercontent.com/" +
|
17
|
+
"jobshop/jobshop/" +
|
18
|
+
"master/lib/jobshop/templates/secrets.yml.erb"
|
15
19
|
|
16
20
|
secrets_tempfile = Tempfile.new(["secrets", ".yml.erb"])
|
17
|
-
|
18
|
-
secrets_tempfile.write(template_body)
|
21
|
+
secrets_tempfile.write(template_body(SECRETS_YML_URI))
|
19
22
|
secrets_tempfile.close
|
20
23
|
|
21
|
-
# The generated config/secrets.yml file uses hardcoded values for
|
22
|
-
# test/development environments. Generate secrets pragmatically.
|
23
24
|
remove_file "config/secrets.yml"
|
24
25
|
template secrets_tempfile.path, "config/secrets.yml"
|
25
26
|
secrets_tempfile.unlink
|
data/lib/jobshop/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jobshop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.41
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Frank J. Mattia
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: coffee-rails
|