Skip to content

Commit 92251a6

Browse files
committed
Rdy4lookin@
1 parent 9dbf45a commit 92251a6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+698
-607
lines changed

.idea/json_api_experiment.iml

+8-15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gemfile

+20-48
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,30 @@
1-
source 'https://rubygems.org'
1+
source "https://rubygems.org"
22
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
33

4-
ruby '2.7.0'
4+
ruby "2.7.0"
55

6-
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
7-
gem 'rails', '~> 6.0.2', '>= 6.0.2.2'
8-
# Use sqlite3 as the database for Active Record
9-
gem 'sqlite3', '~> 1.4'
10-
# Use Puma as the app server
11-
gem 'puma', '~> 4.1'
12-
# Use SCSS for stylesheets
13-
gem 'sass-rails', '>= 6'
14-
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
15-
gem 'webpacker', '~> 4.0'
16-
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
17-
gem 'turbolinks', '~> 5'
18-
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
19-
gem 'jbuilder', '~> 2.7'
20-
# Use Redis adapter to run Action Cable in production
21-
# gem 'redis', '~> 4.0'
22-
# Use Active Model has_secure_password
23-
# gem 'bcrypt', '~> 3.1.7'
6+
gem "rails", "~> 6.0.2", ">= 6.0.2.2"
7+
gem "sqlite3", "~> 1.4"
8+
gem "puma", "~> 4.1"
9+
gem "sass-rails", ">= 6"
10+
gem "webpacker", "~> 4.0"
11+
gem "turbolinks", "~> 5"
12+
gem "devise"
13+
gem "react-rails"
14+
gem "jsonapi-resources"
2415

25-
# Use Active Storage variant
26-
# gem 'image_processing', '~> 1.2'
27-
gem 'devise'
28-
gem 'react-rails'
29-
gem 'jsonapi-resources'
30-
31-
# Reduces boot times through caching; required in config/boot.rb
32-
gem 'bootsnap', '>= 1.4.2', require: false
16+
gem "bootsnap", ">= 1.4.2", require: false
3317

3418
group :development, :test do
35-
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
36-
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
37-
gem 'standard'
19+
gem "byebug", platforms: [:mri, :mingw, :x64_mingw]
20+
gem "standard"
21+
gem "factory_bot_rails"
22+
gem "faker"
3823
end
3924

4025
group :development do
41-
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
42-
gem 'web-console', '>= 3.3.0'
43-
gem 'listen', '>= 3.0.5', '< 3.2'
44-
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
45-
gem 'spring'
46-
gem 'spring-watcher-listen', '~> 2.0.0'
47-
end
48-
49-
group :test do
50-
# Adds support for Capybara system testing and selenium driver
51-
gem 'capybara', '>= 2.15'
52-
gem 'selenium-webdriver'
53-
# Easy installation and use of web drivers to run system tests with browsers
54-
gem 'webdrivers'
26+
gem "web-console", ">= 3.3.0"
27+
gem "listen", ">= 3.0.5", "< 3.2"
28+
gem "spring"
29+
gem "spring-watcher-listen", "~> 2.0.0"
5530
end
56-
57-
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
58-
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

Gemfile.lock

+16-37
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ GEM
5656
minitest (~> 5.1)
5757
tzinfo (~> 1.1)
5858
zeitwerk (~> 2.2)
59-
addressable (2.7.0)
60-
public_suffix (>= 2.0.2, < 5.0)
6159
ast (2.4.0)
6260
babel-source (5.8.35)
6361
babel-transpiler (0.7.0)
@@ -68,16 +66,7 @@ GEM
6866
bootsnap (1.4.6)
6967
msgpack (~> 1.0)
7068
builder (3.2.4)
71-
byebug (11.1.1)
72-
capybara (3.32.1)
73-
addressable
74-
mini_mime (>= 0.1.3)
75-
nokogiri (~> 1.8)
76-
rack (>= 1.6.0)
77-
rack-test (>= 0.6.3)
78-
regexp_parser (~> 1.5)
79-
xpath (~> 3.2)
80-
childprocess (3.0.0)
69+
byebug (11.1.2)
8170
concurrent-ruby (1.1.6)
8271
connection_pool (2.2.2)
8372
crass (1.0.6)
@@ -89,14 +78,19 @@ GEM
8978
warden (~> 1.2.3)
9079
erubi (1.9.0)
9180
execjs (2.7.0)
81+
factory_bot (5.1.1)
82+
activesupport (>= 4.2.0)
83+
factory_bot_rails (5.1.1)
84+
factory_bot (~> 5.1.0)
85+
railties (>= 4.2.0)
86+
faker (2.11.0)
87+
i18n (>= 1.6, < 2)
9288
ffi (1.12.2)
9389
globalid (0.4.2)
9490
activesupport (>= 4.2.0)
9591
i18n (1.8.2)
9692
concurrent-ruby (~> 1.0)
9793
jaro_winkler (1.5.4)
98-
jbuilder (2.10.0)
99-
activesupport (>= 5.0.0)
10094
jsonapi-resources (0.10.2)
10195
activerecord (>= 4.1)
10296
concurrent-ruby
@@ -123,9 +117,8 @@ GEM
123117
mini_portile2 (~> 2.4.0)
124118
orm_adapter (0.5.0)
125119
parallel (1.19.1)
126-
parser (2.7.1.0)
120+
parser (2.7.1.2)
127121
ast (~> 2.4.0)
128-
public_suffix (4.0.4)
129122
puma (4.3.3)
130123
nio4r (~> 2.0)
131124
rack (2.2.2)
@@ -170,24 +163,22 @@ GEM
170163
execjs
171164
railties (>= 3.2)
172165
tilt
173-
regexp_parser (1.7.0)
174166
responders (3.0.0)
175167
actionpack (>= 5.0)
176168
railties (>= 5.0)
177169
rexml (3.2.4)
178-
rubocop (0.80.1)
170+
rubocop (0.82.0)
179171
jaro_winkler (~> 1.5.1)
180172
parallel (~> 1.10)
181173
parser (>= 2.7.0.1)
182174
rainbow (>= 2.2.2, < 4.0)
183175
rexml
184176
ruby-progressbar (~> 1.7)
185-
unicode-display_width (>= 1.4.0, < 1.7)
177+
unicode-display_width (>= 1.4.0, < 2.0)
186178
rubocop-performance (1.5.2)
187179
rubocop (>= 0.71.0)
188180
ruby-progressbar (1.10.1)
189181
ruby_dep (1.5.0)
190-
rubyzip (2.3.0)
191182
sass-rails (6.0.0)
192183
sassc-rails (~> 2.1, >= 2.1.1)
193184
sassc (2.2.1)
@@ -198,9 +189,6 @@ GEM
198189
sprockets (> 3.0)
199190
sprockets-rails
200191
tilt
201-
selenium-webdriver (3.142.7)
202-
childprocess (>= 0.5, < 4.0)
203-
rubyzip (>= 1.2.2)
204192
spring (2.1.0)
205193
spring-watcher-listen (2.0.1)
206194
listen (>= 2.7, < 4.0)
@@ -213,8 +201,8 @@ GEM
213201
activesupport (>= 4.0)
214202
sprockets (>= 3.0.0)
215203
sqlite3 (1.4.2)
216-
standard (0.2.3)
217-
rubocop (~> 0.80.1)
204+
standard (0.4.0)
205+
rubocop (~> 0.82.0)
218206
rubocop-performance (~> 1.5.2)
219207
thor (1.0.1)
220208
thread_safe (0.3.6)
@@ -224,27 +212,21 @@ GEM
224212
turbolinks-source (5.2.0)
225213
tzinfo (1.2.7)
226214
thread_safe (~> 0.1)
227-
unicode-display_width (1.6.1)
215+
unicode-display_width (1.7.0)
228216
warden (1.2.8)
229217
rack (>= 2.0.6)
230218
web-console (4.0.1)
231219
actionview (>= 6.0.0)
232220
activemodel (>= 6.0.0)
233221
bindex (>= 0.4.0)
234222
railties (>= 6.0.0)
235-
webdrivers (4.2.0)
236-
nokogiri (~> 1.6)
237-
rubyzip (>= 1.3.0)
238-
selenium-webdriver (>= 3.0, < 4.0)
239223
webpacker (4.2.2)
240224
activesupport (>= 4.2)
241225
rack-proxy (>= 0.6.1)
242226
railties (>= 4.2)
243227
websocket-driver (0.7.1)
244228
websocket-extensions (>= 0.1.0)
245229
websocket-extensions (0.1.4)
246-
xpath (3.2.0)
247-
nokogiri (~> 1.8)
248230
zeitwerk (2.3.0)
249231

250232
PLATFORMS
@@ -253,24 +235,21 @@ PLATFORMS
253235
DEPENDENCIES
254236
bootsnap (>= 1.4.2)
255237
byebug
256-
capybara (>= 2.15)
257238
devise
258-
jbuilder (~> 2.7)
239+
factory_bot_rails
240+
faker
259241
jsonapi-resources
260242
listen (>= 3.0.5, < 3.2)
261243
puma (~> 4.1)
262244
rails (~> 6.0.2, >= 6.0.2.2)
263245
react-rails
264246
sass-rails (>= 6)
265-
selenium-webdriver
266247
spring
267248
spring-watcher-listen (~> 2.0.0)
268249
sqlite3 (~> 1.4)
269250
standard
270251
turbolinks (~> 5)
271-
tzinfo-data
272252
web-console (>= 3.3.0)
273-
webdrivers
274253
webpacker (~> 4.0)
275254

276255
RUBY VERSION

Rakefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Add your own tasks in files placed in lib/tasks ending in .rake,
22
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
33

4-
require_relative 'config/application'
4+
require_relative "config/application"
55

66
Rails.application.load_tasks

app/assets/stylesheets/application.css

+4
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,7 @@
1313
*= require_tree .
1414
*= require_self
1515
*/
16+
17+
.app {
18+
margin-left: 20px;
19+
}
+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class Api::FearsController < ApiController
2+
end
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
class Api::ThingsController < ApiController
2-
end
2+
end
+4-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
class Api::UsersController < ApiController
2-
end
2+
def dumpy_index
3+
render json: User.all.includes(:fears, :flavors, :things).as_json(include: [:fears, :flavors, :things])
4+
end
5+
end

app/controllers/api_controller.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ class ApiController < ApplicationController
22
include JSONAPI::ActsAsResourceController
33
before_action :authenticate_user!
44
protect_from_forgery with: :null_session
5-
5+
66
def context
77
{current_user: current_user}
88
end
9-
end
9+
end

app/controllers/home_controller.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ class HomeController < ApplicationController
22
before_action :authenticate_user!
33

44
def index
5-
render component: 'App', props: { path: params[:path] || '/' }, tag: 'div', prerender: false
5+
render component: "App", props: {path: params[:path] || "/"}, tag: "div", prerender: false
66
end
77
end

app/javascript/channels/consumer.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Action Cable provides the framework to deal with WebSockets in Rails.
22
// You can generate new channels where WebSocket features live using the `rails generate channel` command.
33

4-
import { createConsumer } from "@rails/actioncable"
4+
import { createConsumer } from "@rails/actioncable";
55

6-
export default createConsumer()
6+
export default createConsumer();

app/javascript/channels/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Load all the channels within this directory and all subdirectories.
22
// Channel files must be named *_channel.js.
33

4-
const channels = require.context('.', true, /_channel\.js$/)
5-
channels.keys().forEach(channels)
4+
const channels = require.context(".", true, /_channel\.js$/);
5+
channels.keys().forEach(channels);

0 commit comments

Comments
 (0)