| @@ -1,244 +1,219 @@ | ||
| GEM | ||
| remote: https://rubygems.org/ | ||
| specs: | ||
| actioncable (5.0.2) | ||
| actionpack (= 5.0.2) | ||
| nio4r (>= 1.2, < 3.0) | ||
| websocket-driver (~> 0.6.1) | ||
| actionmailer (5.0.2) | ||
| actionpack (= 5.0.2) | ||
| actionview (= 5.0.2) | ||
| activejob (= 5.0.2) | ||
| mail (~> 2.5, >= 2.5.4) | ||
| rails-dom-testing (~> 2.0) | ||
| actionpack (5.0.2) | ||
| actionview (= 5.0.2) | ||
| activesupport (= 5.0.2) | ||
| rack (~> 2.0) | ||
| rack-test (~> 0.6.3) | ||
| rails-dom-testing (~> 2.0) | ||
| rails-html-sanitizer (~> 1.0, >= 1.0.2) | ||
| actionview (5.0.2) | ||
| activesupport (= 5.0.2) | ||
| builder (~> 3.1) | ||
| erubis (~> 2.7.0) | ||
| rails-dom-testing (~> 2.0) | ||
| rails-html-sanitizer (~> 1.0, >= 1.0.3) | ||
| activejob (5.0.2) | ||
| activesupport (= 5.0.2) | ||
| globalid (>= 0.3.6) | ||
| activemodel (5.0.2) | ||
| activesupport (= 5.0.2) | ||
| activerecord (5.0.2) | ||
| activemodel (= 5.0.2) | ||
| activesupport (= 5.0.2) | ||
| arel (~> 7.0) | ||
| activesupport (5.0.2) | ||
| concurrent-ruby (~> 1.0, >= 1.0.2) | ||
| i18n (~> 0.7) | ||
| minitest (~> 5.1) | ||
| tzinfo (~> 1.1) | ||
| arel (7.1.4) | ||
| autoprefixer-rails (6.7.7.1) | ||
| execjs | ||
| bcrypt (3.1.11) | ||
| bindex (0.5.0) | ||
| bootstrap-sass (3.3.7) | ||
| autoprefixer-rails (>= 5.2.1) | ||
| sass (>= 3.3.4) | ||
| builder (3.2.3) | ||
| byebug (9.0.6) | ||
| climate_control (0.1.0) | ||
| cocaine (0.5.8) | ||
| climate_control (>= 0.0.3, < 1.0) | ||
| concurrent-ruby (1.0.5) | ||
| devise (4.2.1) | ||
| bcrypt (~> 3.0) | ||
| orm_adapter (~> 0.1) | ||
| railties (>= 4.1.0, < 5.1) | ||
| responders | ||
| warden (~> 1.2.3) | ||
| diff-lcs (1.3) | ||
| erubis (2.7.0) | ||
| execjs (2.7.0) | ||
| ffi (1.9.18) | ||
| globalid (0.3.7) | ||
| activesupport (>= 4.1.0) | ||
| i18n (0.8.1) | ||
| jbuilder (2.6.3) | ||
| activesupport (>= 3.0.0, < 5.2) | ||
| multi_json (~> 1.2) | ||
| jquery-fileupload-rails (0.4.7) | ||
| actionpack (>= 3.1) | ||
| railties (>= 3.1) | ||
| sass (>= 3.2) | ||
| jquery-rails (4.3.1) | ||
| rails-dom-testing (>= 1, < 3) | ||
| railties (>= 4.2.0) | ||
| thor (>= 0.14, < 2.0) | ||
| listen (3.0.8) | ||
| rb-fsevent (~> 0.9, >= 0.9.4) | ||
| rb-inotify (~> 0.9, >= 0.9.7) | ||
| loofah (2.0.3) | ||
| nokogiri (>= 1.5.9) | ||
| mail (2.6.4) | ||
| mime-types (>= 1.16, < 4) | ||
| method_source (0.8.2) | ||
| mime-types (3.1) | ||
| mime-types-data (~> 3.2015) | ||
| mime-types-data (3.2016.0521) | ||
| mimemagic (0.3.2) | ||
| mini_portile2 (2.1.0) | ||
| minitest (5.10.1) | ||
| multi_json (1.12.1) | ||
| nio4r (2.0.0) | ||
| nokogiri (1.7.1) | ||
| mini_portile2 (~> 2.1.0) | ||
| orm_adapter (0.5.0) | ||
| paperclip (5.1.0) | ||
| activemodel (>= 4.2.0) | ||
| activesupport (>= 4.2.0) | ||
| cocaine (~> 0.5.5) | ||
| mime-types | ||
| mimemagic (~> 0.3.0) | ||
| pg (0.20.0) | ||
| puma (3.8.2) | ||
| rack (2.0.1) | ||
| rack-test (0.6.3) | ||
| rack (>= 1.0) | ||
| rails (5.0.2) | ||
| actioncable (= 5.0.2) | ||
| actionmailer (= 5.0.2) | ||
| actionpack (= 5.0.2) | ||
| actionview (= 5.0.2) | ||
| activejob (= 5.0.2) | ||
| activemodel (= 5.0.2) | ||
| activerecord (= 5.0.2) | ||
| activesupport (= 5.0.2) | ||
| bundler (>= 1.3.0, < 2.0) | ||
| railties (= 5.0.2) | ||
| sprockets-rails (>= 2.0.0) | ||
| rails-dom-testing (2.0.2) | ||
| activesupport (>= 4.2.0, < 6.0) | ||
| nokogiri (~> 1.6) | ||
| rails-html-sanitizer (1.0.3) | ||
| loofah (~> 2.0) | ||
| railties (5.0.2) | ||
| actionpack (= 5.0.2) | ||
| activesupport (= 5.0.2) | ||
| method_source | ||
| rake (>= 0.8.7) | ||
| thor (>= 0.18.1, < 2.0) | ||
| rake (12.0.0) | ||
| rb-fsevent (0.9.8) | ||
| rb-inotify (0.9.8) | ||
| ffi (>= 0.5.0) | ||
| responders (2.3.0) | ||
| railties (>= 4.2.0, < 5.1) | ||
| rspec-core (3.5.4) | ||
| rspec-support (~> 3.5.0) | ||
| rspec-expectations (3.5.0) | ||
| diff-lcs (>= 1.2.0, < 2.0) | ||
| rspec-support (~> 3.5.0) | ||
| rspec-mocks (3.5.0) | ||
| diff-lcs (>= 1.2.0, < 2.0) | ||
| rspec-support (~> 3.5.0) | ||
| rspec-rails (3.5.2) | ||
| actionpack (>= 3.0) | ||
| activesupport (>= 3.0) | ||
| railties (>= 3.0) | ||
| rspec-core (~> 3.5.0) | ||
| rspec-expectations (~> 3.5.0) | ||
| rspec-mocks (~> 3.5.0) | ||
| rspec-support (~> 3.5.0) | ||
| rspec-support (3.5.0) | ||
| sass (3.4.23) | ||
| sass-rails (5.0.6) | ||
| railties (>= 4.0.0, < 6) | ||
| sass (~> 3.1) | ||
| sprockets (>= 2.8, < 4.0) | ||
| sprockets-rails (>= 2.0, < 4.0) | ||
| tilt (>= 1.1, < 3) | ||
| spring (2.0.1) | ||
| activesupport (>= 4.2) | ||
| spring-watcher-listen (2.0.1) | ||
| listen (>= 2.7, < 4.0) | ||
| spring (>= 1.2, < 3.0) | ||
| sprockets (3.7.1) | ||
| concurrent-ruby (~> 1.0) | ||
| rack (> 1, < 3) | ||
| sprockets-rails (3.2.0) | ||
| actionpack (>= 4.0) | ||
| activesupport (>= 4.0) | ||
| sprockets (>= 3.0.0) | ||
| thor (0.19.4) | ||
| thread_safe (0.3.6) | ||
| tilt (2.0.7) | ||
| turbolinks (5.0.1) | ||
| turbolinks-source (~> 5) | ||
| turbolinks-source (5.0.0) | ||
| tzinfo (1.2.3) | ||
| thread_safe (~> 0.1) | ||
| uglifier (3.1.13) | ||
| execjs (>= 0.3.0, < 3) | ||
| warden (1.2.7) | ||
| rack (>= 1.0) | ||
| web-console (3.5.0) | ||
| actionview (>= 5.0) | ||
| activemodel (>= 5.0) | ||
| bindex (>= 0.4.0) | ||
| railties (>= 5.0) | ||
| websocket-driver (0.6.5) | ||
| websocket-extensions (>= 0.1.0) | ||
| websocket-extensions (0.1.2) | ||
|
|
||
| PLATFORMS | ||
| ruby | ||
|
|
||
| DEPENDENCIES | ||
| bootstrap-sass (~> 3.3.7) | ||
| byebug | ||
| devise | ||
| jbuilder (~> 2.5) | ||
| jquery-fileupload-rails | ||
| jquery-rails | ||
| listen (~> 3.0.5) | ||
| paperclip (~> 5.1.0) | ||
| pg (~> 0.18) | ||
| puma (~> 3.0) | ||
| rails (~> 5.0.2) | ||
| rspec-rails (~> 3.5) | ||
| sass-rails (~> 5.0) | ||
| spring | ||
| spring-watcher-listen (~> 2.0.0) | ||
| turbolinks (~> 5) | ||
| uglifier (>= 1.3.0) | ||
| web-console (>= 3.3.0) | ||
|
|
||
| BUNDLED WITH | ||
| 1.14.6 |
| @@ -0,0 +1,22 @@ | ||
| # Comics | ||
|
|
||
| Tablet-first comic reader. | ||
|
|
||
| ## Setup | ||
|
|
||
| Local development is done with [Docker Compose](https://docs.docker.com/compose/) and uses the [ruby](https://hub.docker.com/_/ruby/) and [postgres](https://hub.docker.com/_/postgres/) repos. | ||
| Make sure you have Docker Compose installed, then run: | ||
|
|
||
| ``` | ||
| $ docker-compose up | ||
| ``` | ||
|
|
||
| ## Deploy | ||
|
|
||
| Any Unix-like server running Ruby 2+ and Postgres 9.5+ should work. | ||
|
|
||
| | Requirements | | | | ||
| | ------------ |-|-| | ||
| | imagemagick | `apt-get install imagemagick` | | | ||
| | unrar | `apt-get install unrar` | (debian note: this must be the 'non-free' package) | | ||
| | unzip | `apt-get install unzip` | | |
| @@ -1,6 +1,6 @@ | ||
| # Add your own tasks in files placed in lib/tasks ending in .rake, | ||
| # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. | ||
|
|
||
| require_relative 'config/application' | ||
|
|
||
| Rails.application.load_tasks |
| @@ -0,0 +1,3 @@ | ||
| //= link_tree ../images | ||
| //= link_directory ../javascripts .js | ||
| //= link_directory ../stylesheets .css |
| @@ -0,0 +1,13 @@ | ||
| // Action Cable provides the framework to deal with WebSockets in Rails. | ||
| // You can generate new channels where WebSocket features live using the rails generate channel command. | ||
| // | ||
| //= require action_cable | ||
| //= require_self | ||
| //= require_tree ./channels | ||
|
|
||
| (function() { | ||
| this.App || (this.App = {}); | ||
|
|
||
| App.cable = ActionCable.createConsumer(); | ||
|
|
||
| }).call(this); |
| @@ -0,0 +1,4 @@ | ||
| module ApplicationCable | ||
| class Channel < ActionCable::Channel::Base | ||
| end | ||
| end |
| @@ -0,0 +1,4 @@ | ||
| module ApplicationCable | ||
| class Connection < ActionCable::Connection::Base | ||
| end | ||
| end |
| @@ -0,0 +1,2 @@ | ||
| class ApplicationJob < ActiveJob::Base | ||
| end |
| @@ -0,0 +1,4 @@ | ||
| class ApplicationMailer < ActionMailer::Base | ||
| default from: 'no-reply@twono.de' | ||
| layout 'mailer' | ||
| end |
| @@ -0,0 +1,3 @@ | ||
| class ApplicationRecord < ActiveRecord::Base | ||
| self.abstract_class = true | ||
| end |
| @@ -0,0 +1,13 @@ | ||
| <!DOCTYPE html> | ||
| <html> | ||
| <head> | ||
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||
| <style> | ||
| /* Email styles need to be inline */ | ||
| </style> | ||
| </head> | ||
|
|
||
| <body> | ||
| <%= yield %> | ||
| </body> | ||
| </html> |
| @@ -0,0 +1 @@ | ||
| <%= yield %> |
| @@ -1,9 +1,4 @@ | ||
| #!/usr/bin/env ruby | ||
| APP_PATH = File.expand_path('../config/application', __dir__) | ||
| require_relative '../config/boot' | ||
| require 'rails/commands' |
| @@ -1,9 +1,4 @@ | ||
| #!/usr/bin/env ruby | ||
| require_relative '../config/boot' | ||
| require 'rake' | ||
| Rake.application.run |
| @@ -1,29 +1,34 @@ | ||
| #!/usr/bin/env ruby | ||
| require 'pathname' | ||
| require 'fileutils' | ||
| include FileUtils | ||
|
|
||
| # path to your application root. | ||
| APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) | ||
|
|
||
| def system!(*args) | ||
| system(*args) || abort("\n== Command #{args} failed ==") | ||
| end | ||
|
|
||
| chdir APP_ROOT do | ||
| # This script is a starting point to setup your application. | ||
| # Add necessary setup steps to this file. | ||
|
|
||
| puts '== Installing dependencies ==' | ||
| system! 'gem install bundler --conservative' | ||
| system('bundle check') || system!('bundle install') | ||
|
|
||
| # puts "\n== Copying sample files ==" | ||
| # unless File.exist?('config/database.yml') | ||
| # cp 'config/database.yml.sample', 'config/database.yml' | ||
| # end | ||
|
|
||
| puts "\n== Preparing database ==" | ||
| system! 'bin/rails db:setup' | ||
|
|
||
| puts "\n== Removing old logs and tempfiles ==" | ||
| system! 'bin/rails log:clear tmp:clear' | ||
|
|
||
| puts "\n== Restarting application server ==" | ||
| system! 'bin/rails restart' | ||
| end |
| @@ -0,0 +1,29 @@ | ||
| #!/usr/bin/env ruby | ||
| require 'pathname' | ||
| require 'fileutils' | ||
| include FileUtils | ||
|
|
||
| # path to your application root. | ||
| APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) | ||
|
|
||
| def system!(*args) | ||
| system(*args) || abort("\n== Command #{args} failed ==") | ||
| end | ||
|
|
||
| chdir APP_ROOT do | ||
| # This script is a way to update your development environment automatically. | ||
| # Add necessary update steps to this file. | ||
|
|
||
| puts '== Installing dependencies ==' | ||
| system! 'gem install bundler --conservative' | ||
| system('bundle check') || system!('bundle install') | ||
|
|
||
| puts "\n== Updating database ==" | ||
| system! 'bin/rails db:migrate' | ||
|
|
||
| puts "\n== Removing old logs and tempfiles ==" | ||
| system! 'bin/rails log:clear tmp:clear' | ||
|
|
||
| puts "\n== Restarting application server ==" | ||
| system! 'bin/rails restart' | ||
| end |
| @@ -1,4 +1,5 @@ | ||
| # This file is used by Rack-based servers to start the application. | ||
|
|
||
| require_relative 'config/environment' | ||
|
|
||
| run Rails.application |
| @@ -1,3 +1,3 @@ | ||
| ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) | ||
|
|
||
| require 'bundler/setup' # Set up gems listed in the Gemfile. |
| @@ -0,0 +1,9 @@ | ||
| development: | ||
| adapter: async | ||
|
|
||
| test: | ||
| adapter: async | ||
|
|
||
| production: | ||
| adapter: redis | ||
| url: redis://localhost:6379/1 |
| @@ -0,0 +1,91 @@ | ||
| # PostgreSQL. Versions 9.1 and up are supported. | ||
| # | ||
| # Install the pg driver: | ||
| # gem install pg | ||
| # On OS X with Homebrew: | ||
| # gem install pg -- --with-pg-config=/usr/local/bin/pg_config | ||
| # On OS X with MacPorts: | ||
| # gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config | ||
| # On Windows: | ||
| # gem install pg | ||
| # Choose the win32 build. | ||
| # Install PostgreSQL and put its /bin directory on your path. | ||
| # | ||
| # Configure Using Gemfile | ||
| # gem 'pg' | ||
| # | ||
| default: &default | ||
| adapter: postgresql | ||
| encoding: unicode | ||
| # For details on connection pooling, see rails configuration guide | ||
| # http://guides.rubyonrails.org/configuring.html#database-pooling | ||
| pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> | ||
|
|
||
| development: | ||
| <<: *default | ||
| database: comics_development | ||
| username: postgres | ||
| password: | ||
| host: db | ||
|
|
||
| # The specified database role being used to connect to postgres. | ||
| # To create additional roles in postgres see `$ createuser --help`. | ||
| # When left blank, postgres will use the default role. This is | ||
| # the same name as the operating system user that initialized the database. | ||
| #username: comics | ||
|
|
||
| # The password associated with the postgres role (username). | ||
| #password: | ||
|
|
||
| # Connect on a TCP socket. Omitted by default since the client uses a | ||
| # domain socket that doesn't need configuration. Windows does not have | ||
| # domain sockets, so uncomment these lines. | ||
| #host: localhost | ||
|
|
||
| # The TCP port the server listens on. Defaults to 5432. | ||
| # If your server runs on a different port number, change accordingly. | ||
| #port: 5432 | ||
|
|
||
| # Schema search path. The server defaults to $user,public | ||
| #schema_search_path: myapp,sharedapp,public | ||
|
|
||
| # Minimum log levels, in increasing order: | ||
| # debug5, debug4, debug3, debug2, debug1, | ||
| # log, notice, warning, error, fatal, and panic | ||
| # Defaults to warning. | ||
| #min_messages: notice | ||
|
|
||
| # Warning: The database defined as "test" will be erased and | ||
| # re-generated from your development database when you run "rake". | ||
| # Do not set this db to the same as development or production. | ||
| test: | ||
| <<: *default | ||
| database: comics_test | ||
| username: postgres | ||
| password: | ||
| host: db | ||
|
|
||
| # As with config/secrets.yml, you never want to store sensitive information, | ||
| # like your database password, in your source code. If your source code is | ||
| # ever seen by anyone, they now have access to your database. | ||
| # | ||
| # Instead, provide the password as a unix environment variable when you boot | ||
| # the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database | ||
| # for a full rundown on how to provide these environment variables in a | ||
| # production deployment. | ||
| # | ||
| # On Heroku and other platform providers, you may have a full connection URL | ||
| # available as an environment variable. For example: | ||
| # | ||
| # DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase" | ||
| # | ||
| # You can use this database configuration with: | ||
| # | ||
| # production: | ||
| # url: <%= ENV['DATABASE_URL'] %> | ||
| # | ||
| production: | ||
| <<: *default | ||
| database: comics | ||
| username: <%= ENV['COMICS_DATABASE_USERNAME'] %> | ||
| password: <%= ENV['COMICS_DATABASE_PASSWORD'] %> |
| @@ -1,5 +1,5 @@ | ||
| # Load the Rails application. | ||
| require_relative 'application' | ||
|
|
||
| # Initialize the Rails application. | ||
| Rails.application.initialize! |
| @@ -0,0 +1,6 @@ | ||
| # Be sure to restart your server when you modify this file. | ||
|
|
||
| # ApplicationController.renderer.defaults.merge!( | ||
| # http_host: 'example.org', | ||
| # https: false | ||
| # ) |
| @@ -1,3 +1,5 @@ | ||
| # Be sure to restart your server when you modify this file. | ||
|
|
||
| # Specify a serializer for the signed and encrypted cookie jars. | ||
| # Valid options are :json, :marshal, and :hybrid. | ||
| Rails.application.config.action_dispatch.cookies_serializer = :json |
| @@ -0,0 +1,24 @@ | ||
| # Be sure to restart your server when you modify this file. | ||
| # | ||
| # This file contains migration options to ease your Rails 5.0 upgrade. | ||
| # | ||
| # Read the Guide for Upgrading Ruby on Rails for more info on each option. | ||
|
|
||
| # Enable per-form CSRF tokens. Previous versions had false. | ||
| Rails.application.config.action_controller.per_form_csrf_tokens = true | ||
|
|
||
| # Enable origin-checking CSRF mitigation. Previous versions had false. | ||
| Rails.application.config.action_controller.forgery_protection_origin_check = true | ||
|
|
||
| # Make Ruby 2.4 preserve the timezone of the receiver when calling `to_time`. | ||
| # Previous versions had false. | ||
| ActiveSupport.to_time_preserves_timezone = true | ||
|
|
||
| # Require `belongs_to` associations by default. Previous versions had false. | ||
| Rails.application.config.active_record.belongs_to_required_by_default = true | ||
|
|
||
| # Do not halt callback chains when a callback returns false. Previous versions had true. | ||
| ActiveSupport.halt_callback_chains_on_return_false = false | ||
|
|
||
| # Configure SSL options to enable HSTS with subdomains. Previous versions had false. | ||
| Rails.application.config.ssl_options = { hsts: { subdomains: true } } |
| @@ -0,0 +1,47 @@ | ||
| # Puma can serve each request in a thread from an internal thread pool. | ||
| # The `threads` method setting takes two numbers a minimum and maximum. | ||
| # Any libraries that use thread pools should be configured to match | ||
| # the maximum value specified for Puma. Default is set to 5 threads for minimum | ||
| # and maximum, this matches the default thread size of Active Record. | ||
| # | ||
| threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }.to_i | ||
| threads threads_count, threads_count | ||
|
|
||
| # Specifies the `port` that Puma will listen on to receive requests, default is 3000. | ||
| # | ||
| port ENV.fetch("PORT") { 3000 } | ||
|
|
||
| # Specifies the `environment` that Puma will run in. | ||
| # | ||
| environment ENV.fetch("RAILS_ENV") { "development" } | ||
|
|
||
| # Specifies the number of `workers` to boot in clustered mode. | ||
| # Workers are forked webserver processes. If using threads and workers together | ||
| # the concurrency of the application would be max `threads` * `workers`. | ||
| # Workers do not work on JRuby or Windows (both of which do not support | ||
| # processes). | ||
| # | ||
| # workers ENV.fetch("WEB_CONCURRENCY") { 2 } | ||
|
|
||
| # Use the `preload_app!` method when specifying a `workers` number. | ||
| # This directive tells Puma to first boot the application and load code | ||
| # before forking the application. This takes advantage of Copy On Write | ||
| # process behavior so workers use less memory. If you use this option | ||
| # you need to make sure to reconnect any threads in the `on_worker_boot` | ||
| # block. | ||
| # | ||
| # preload_app! | ||
|
|
||
| # The code in the `on_worker_boot` will be called if you are using | ||
| # clustered mode by specifying a number of `workers`. After each worker | ||
| # process is booted this block will be run, if you are using `preload_app!` | ||
| # option you will want to use this block to reconnect to any threads | ||
| # or connections that may have been created at application boot, Ruby | ||
| # cannot share connections between processes. | ||
| # | ||
| # on_worker_boot do | ||
| # ActiveRecord::Base.establish_connection if defined?(ActiveRecord) | ||
| # end | ||
|
|
||
| # Allow puma to be restarted by `rails restart` command. | ||
| plugin :tmp_restart |
| @@ -1,59 +1,4 @@ | ||
| Rails.application.routes.draw do | ||
| devise_for :users | ||
|
|
||
| resources :groups do | ||
| @@ -0,0 +1,6 @@ | ||
| %w( | ||
| .ruby-version | ||
| .rbenv-vars | ||
| tmp/restart.txt | ||
| tmp/caching-dev.txt | ||
| ).each { |path| Spring.watch(path) } |
| @@ -0,0 +1,42 @@ | ||
| class DeviseCreateUsers < ActiveRecord::Migration[5.0] | ||
| def change | ||
| create_table :users do |t| | ||
| ## Database authenticatable | ||
| t.string :email, null: false, default: "" | ||
| t.string :encrypted_password, null: false, default: "" | ||
|
|
||
| ## Recoverable | ||
| t.string :reset_password_token | ||
| t.datetime :reset_password_sent_at | ||
|
|
||
| ## Rememberable | ||
| t.datetime :remember_created_at | ||
|
|
||
| ## Trackable | ||
| t.integer :sign_in_count, default: 0, null: false | ||
| t.datetime :current_sign_in_at | ||
| t.datetime :last_sign_in_at | ||
| t.inet :current_sign_in_ip | ||
| t.inet :last_sign_in_ip | ||
|
|
||
| ## Confirmable | ||
| # t.string :confirmation_token | ||
| # t.datetime :confirmed_at | ||
| # t.datetime :confirmation_sent_at | ||
| # t.string :unconfirmed_email # Only if using reconfirmable | ||
|
|
||
| ## Lockable | ||
| # t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts | ||
| # t.string :unlock_token # Only if unlock strategy is :email or :both | ||
| # t.datetime :locked_at | ||
|
|
||
|
|
||
| t.timestamps null: false | ||
| end | ||
|
|
||
| add_index :users, :email, unique: true | ||
| add_index :users, :reset_password_token, unique: true | ||
| # add_index :users, :confirmation_token, unique: true | ||
| # add_index :users, :unlock_token, unique: true | ||
| end | ||
| end |
| @@ -0,0 +1,10 @@ | ||
| class CreateGroups < ActiveRecord::Migration[5.0] | ||
| def change | ||
| create_table :groups do |t| | ||
| t.string :name | ||
| t.references :user, foreign_key: true | ||
|
|
||
| t.timestamps | ||
| end | ||
| end | ||
| end |
| @@ -0,0 +1,11 @@ | ||
| class CreateComics < ActiveRecord::Migration[5.0] | ||
| def change | ||
| create_table :comics do |t| | ||
| t.string :filename | ||
| t.references :user, foreign_key: true | ||
| t.references :group, foreign_key: true | ||
|
|
||
| t.timestamps | ||
| end | ||
| end | ||
| end |
| @@ -0,0 +1,11 @@ | ||
| class CreatePages < ActiveRecord::Migration[5.0] | ||
| def change | ||
| create_table :pages do |t| | ||
| t.integer :number | ||
| t.boolean :read, default: false | ||
| t.references :comic, foreign_key: true | ||
|
|
||
| t.timestamps | ||
| end | ||
| end | ||
| end |
| @@ -0,0 +1,11 @@ | ||
| class AddAttachmentImageToPages < ActiveRecord::Migration | ||
| def self.up | ||
| change_table :pages do |t| | ||
| t.attachment :image | ||
| end | ||
| end | ||
|
|
||
| def self.down | ||
| remove_attachment :pages, :image | ||
| end | ||
| end |
| @@ -0,0 +1,70 @@ | ||
| # This file is auto-generated from the current state of the database. Instead | ||
| # of editing this file, please use the migrations feature of Active Record to | ||
| # incrementally modify your database, and then regenerate this schema definition. | ||
| # | ||
| # Note that this schema.rb definition is the authoritative source for your | ||
| # database schema. If you need to create the application database on another | ||
| # system, you should be using db:schema:load, not running all the migrations | ||
| # from scratch. The latter is a flawed and unsustainable approach (the more migrations | ||
| # you'll amass, the slower it'll run and the greater likelihood for issues). | ||
| # | ||
| # It's strongly recommended that you check this file into your version control system. | ||
|
|
||
| ActiveRecord::Schema.define(version: 20170408181858) do | ||
|
|
||
| # These are extensions that must be enabled in order to support this database | ||
| enable_extension "plpgsql" | ||
|
|
||
| create_table "comics", force: :cascade do |t| | ||
| t.string "filename" | ||
| t.integer "user_id" | ||
| t.integer "group_id" | ||
| t.datetime "created_at", null: false | ||
| t.datetime "updated_at", null: false | ||
| t.index ["group_id"], name: "index_comics_on_group_id", using: :btree | ||
| t.index ["user_id"], name: "index_comics_on_user_id", using: :btree | ||
| end | ||
|
|
||
| create_table "groups", force: :cascade do |t| | ||
| t.string "name" | ||
| t.integer "user_id" | ||
| t.datetime "created_at", null: false | ||
| t.datetime "updated_at", null: false | ||
| t.index ["user_id"], name: "index_groups_on_user_id", using: :btree | ||
| end | ||
|
|
||
| create_table "pages", force: :cascade do |t| | ||
| t.integer "number" | ||
| t.boolean "read", default: false | ||
| t.integer "comic_id" | ||
| t.datetime "created_at", null: false | ||
| t.datetime "updated_at", null: false | ||
| t.string "image_file_name" | ||
| t.string "image_content_type" | ||
| t.integer "image_file_size" | ||
| t.datetime "image_updated_at" | ||
| t.index ["comic_id"], name: "index_pages_on_comic_id", using: :btree | ||
| end | ||
|
|
||
| create_table "users", force: :cascade do |t| | ||
| t.string "email", default: "", null: false | ||
| t.string "encrypted_password", default: "", null: false | ||
| t.string "reset_password_token" | ||
| t.datetime "reset_password_sent_at" | ||
| t.datetime "remember_created_at" | ||
| t.integer "sign_in_count", default: 0, null: false | ||
| t.datetime "current_sign_in_at" | ||
| t.datetime "last_sign_in_at" | ||
| t.inet "current_sign_in_ip" | ||
| t.inet "last_sign_in_ip" | ||
| t.datetime "created_at", null: false | ||
| t.datetime "updated_at", null: false | ||
| t.index ["email"], name: "index_users_on_email", unique: true, using: :btree | ||
| t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree | ||
| end | ||
|
|
||
| add_foreign_key "comics", "groups" | ||
| add_foreign_key "comics", "users" | ||
| add_foreign_key "groups", "users" | ||
| add_foreign_key "pages", "comics" | ||
| end |
| @@ -1,7 +1,7 @@ | ||
| # This file should contain all the record creation needed to seed the database with its default values. | ||
| # The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup). | ||
| # | ||
| # Examples: | ||
| # | ||
| # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) | ||
| # Character.create(name: 'Luke', movie: movies.first) |
| @@ -0,0 +1,14 @@ | ||
| version: '2' | ||
| services: | ||
| db: | ||
| image: postgres | ||
|
|
||
| web: | ||
| build: . | ||
| command: bundle exec rails server -p 3000 -b '0.0.0.0' | ||
| volumes: | ||
| - .:/app | ||
| ports: | ||
| - "3000:3000" | ||
| depends_on: | ||
| - db |