Skip to content

Commit 731a42b

Browse files
author
pbmolini
committed
removed namey, problem fixed in home, secret for staging
1 parent 7fba230 commit 731a42b

File tree

7 files changed

+28
-21
lines changed

7 files changed

+28
-21
lines changed

.gitignore

+4-3
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@
1818

1919
.byebug_history
2020

21-
/db-data/*
21+
/db-data*/*
2222
/public/uploads
23+
/public/assets
2324

24-
docker-compose.production.yml
25-
docker-compose.staging.yml
25+
Dockerfile.*
26+
docker-compose.*.yml

Gemfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ gem 'geocoder'
5656

5757
# Localization
5858
gem 'gettext_i18n_rails'
59-
gem 'gettext_i18n_rails_js', '~> 1.0.0'
59+
gem 'gettext_i18n_rails_js', '~> 1.2.0'
6060
gem 'i18n_data'
6161
# From branch master to work with Rails 5
6262
gem 'globalize', git: 'https://github.com/globalize/globalize'
@@ -77,7 +77,7 @@ gem 'mini_magick'
7777
gem 'simple_form_fancy_uploads'
7878

7979
# random names
80-
gem 'namey'
80+
# gem 'namey'
8181

8282
group :development, :test do
8383
# Call 'byebug' anywhere in the code to stop execution and get a debugger console

Gemfile.lock

+2-8
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ GEM
113113
text (>= 1.3.0)
114114
gettext_i18n_rails (1.8.0)
115115
fast_gettext (>= 0.9.0)
116-
gettext_i18n_rails_js (1.0.4)
116+
gettext_i18n_rails_js (1.2.0)
117117
gettext (>= 3.0.2)
118118
gettext_i18n_rails (>= 0.7.1)
119119
po_to_json (>= 1.0.0)
@@ -157,9 +157,6 @@ GEM
157157
mini_portile2 (2.2.0)
158158
minitest (5.10.3)
159159
multi_json (1.12.1)
160-
namey (0.0.12)
161-
sequel (~> 4.48)
162-
sqlite3
163160
nio4r (2.1.0)
164161
nokogiri (1.8.0)
165162
mini_portile2 (~> 2.2.0)
@@ -236,7 +233,6 @@ GEM
236233
selenium-webdriver (3.5.1)
237234
childprocess (~> 0.5)
238235
rubyzip (~> 1.0)
239-
sequel (4.49.0)
240236
simple_form (3.5.0)
241237
actionpack (> 4, < 5.2)
242238
activemodel (> 4, < 5.2)
@@ -257,7 +253,6 @@ GEM
257253
actionpack (>= 4.0)
258254
activesupport (>= 4.0)
259255
sprockets (>= 3.0.0)
260-
sqlite3 (1.3.13)
261256
text (1.3.1)
262257
thor (0.20.0)
263258
thread_safe (0.3.6)
@@ -302,7 +297,7 @@ DEPENDENCIES
302297
font-awesome-rails
303298
geocoder
304299
gettext_i18n_rails
305-
gettext_i18n_rails_js (~> 1.0.0)
300+
gettext_i18n_rails_js (~> 1.2.0)
306301
globalize!
307302
high_voltage (~> 3.0.0)
308303
i18n_data
@@ -312,7 +307,6 @@ DEPENDENCIES
312307
listen (>= 3.0.5, < 3.2)
313308
lograge
314309
mini_magick
315-
namey
316310
pg (~> 0.18)
317311
pry-rails
318312
puma (~> 3.7)

app/controllers/pages_controller.rb

+7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
class PagesController < ApplicationController
22
include HighVoltage::StaticPage
33

4+
before_action :home
45
# before_filter :authenticate
56
# layout :layout_for_page
67

@@ -14,4 +15,10 @@ def layout_for_page
1415
'application'
1516
end
1617
end
18+
19+
def home
20+
if params[:id] == 'home'
21+
@featured_stories = Story.last(10)
22+
end
23+
end
1724
end

app/controllers/users/registrations_controller.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def after_sign_up_path_for(resource)
6363
private
6464

6565
def generate_name
66-
name = [Namey::Generator.new.name(:common, false), rand(100..999)].join
66+
name = [('a'..'z').to_a.shuffle[0,8].join, rand(100..999)].join
6767
if Commoner.exists?(["lower(name) = ?", name.downcase])
6868
generate_name
6969
else

app/views/pages/home.html.erb

+9-7
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div class="row justify-content-center">
33
<div class="col">
44
<div class="logo-container">
5-
<%= inline_svg 'logo', id: 'logo-svg' %>
5+
<%= inline_svg 'logo.svg', id: 'logo-svg' %>
66
</div>
77
</div>
88
</div>
@@ -18,11 +18,13 @@
1818
<% end %>
1919
</p>
2020
</div>
21-
<h2 class="text-center">Latest Stories</h2>
22-
<div class="row">
23-
<% Story.last(10).each do |story| %>
24-
<div class="col-lg-4 col-md-6">
25-
<%= render 'stories/card', story: story %>
21+
<% if @featured_stories.any? %>
22+
<h2 class="text-center">Latest Stories</h2>
23+
<div class="row">
24+
<% @featured_stories.each do |story| %>
25+
<div class="col-lg-4 col-md-6">
26+
<%= render 'stories/card', story: story %>
27+
</div>
28+
<% end %>
2629
</div>
2730
<% end %>
28-
</div>

config/secrets.yml

+3
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,8 @@ test:
2828
# Or, use `bin/rails secrets:setup` to configure encrypted secrets
2929
# and move the `production:` environment over there.
3030

31+
staging:
32+
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
33+
3134
production:
3235
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>

0 commit comments

Comments
 (0)