date_book 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.idea/vcs.xml +6 -0
- data/.rspec +2 -0
- data/.rubocop.yml +23 -0
- data/.rubocop_todo.yml +7 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/.travis.yml +3 -0
- data/Gemfile +94 -0
- data/Gemfile.lock +385 -0
- data/LICENSE.txt +20 -0
- data/README.md +64 -0
- data/Rakefile +30 -0
- data/VERSION +1 -0
- data/app/assets/images/date_book/.keep +0 -0
- data/app/assets/javascripts/date_book.js +21 -0
- data/app/assets/javascripts/date_book/calendar_events.js +57 -0
- data/app/assets/javascripts/date_book/event_form.js +31 -0
- data/app/assets/javascripts/date_book/popovers.js +3 -0
- data/app/assets/javascripts/date_book/wysiwyg.js +8 -0
- data/app/assets/stylesheets/date_book.css.scss +46 -0
- data/app/controllers/date_book/calendars_controller.rb +60 -0
- data/app/controllers/date_book/date_book_controller.rb +24 -0
- data/app/controllers/date_book/events_controller.rb +105 -0
- data/app/controllers/date_book/graphql_controller.rb +35 -0
- data/app/graphql/date_book_schema.rb +18 -0
- data/app/graphql/types/calendar_type.rb +14 -0
- data/app/graphql/types/date_time_type.rb +7 -0
- data/app/graphql/types/event_occurrence_type.rb +11 -0
- data/app/graphql/types/event_type.rb +19 -0
- data/app/graphql/types/mutation_type.rb +5 -0
- data/app/graphql/types/profile_type.rb +7 -0
- data/app/graphql/types/query_type.rb +57 -0
- data/app/helpers/date_book/application_helper.rb +35 -0
- data/app/helpers/date_book/calendar_helper.rb +4 -0
- data/app/helpers/date_book/events_helper.rb +42 -0
- data/app/jobs/date_book/application_job.rb +6 -0
- data/app/mailers/date_book/application_mailer.rb +9 -0
- data/app/views/date_book/application/_all_day_checkbox.html.haml +1 -0
- data/app/views/date_book/application/_date_range.html.haml +8 -0
- data/app/views/date_book/application/_wysiwyg.html.haml +65 -0
- data/app/views/date_book/calendars/_form.html.haml +6 -0
- data/app/views/date_book/calendars/edit.html.haml +5 -0
- data/app/views/date_book/calendars/index.html.haml +28 -0
- data/app/views/date_book/calendars/new.html.haml +5 -0
- data/app/views/date_book/calendars/show.html.haml +28 -0
- data/app/views/date_book/events/_event.json.jbuilder +12 -0
- data/app/views/date_book/events/_form.html.haml +16 -0
- data/app/views/date_book/events/_occurrence_dates.html.haml +11 -0
- data/app/views/date_book/events/edit.html.haml +5 -0
- data/app/views/date_book/events/fields/_date.html.haml +1 -0
- data/app/views/date_book/events/fields/_day.html.haml +1 -0
- data/app/views/date_book/events/fields/_day_of_week.html.haml +19 -0
- data/app/views/date_book/events/fields/_duration.html.haml +6 -0
- data/app/views/date_book/events/fields/_interval.html.haml +1 -0
- data/app/views/date_book/events/fields/_time.html.haml +1 -0
- data/app/views/date_book/events/index.html.haml +16 -0
- data/app/views/date_book/events/new.html.haml +5 -0
- data/app/views/date_book/events/popover.html.haml +7 -0
- data/app/views/date_book/events/rules/_daily.html.haml +4 -0
- data/app/views/date_book/events/rules/_monthly.html.haml +5 -0
- data/app/views/date_book/events/rules/_singular.html.haml +4 -0
- data/app/views/date_book/events/rules/_weekly.html.haml +5 -0
- data/app/views/date_book/events/show.html.haml +16 -0
- data/app/views/layouts/_date_book_scripts.html.haml +4 -0
- data/app/views/layouts/blank.html.haml +1 -0
- data/bin/rails +15 -0
- data/config/locales/en.yml +44 -0
- data/config/routes.rb +12 -0
- data/date_book.gemspec +337 -0
- data/db/migrate/20170807133845_create_calendars.rb +11 -0
- data/db/migrate/20170807133846_create_events.rb +20 -0
- data/db/migrate/20170807133847_create_schedules.rb +25 -0
- data/db/migrate/20170807133848_add_fields_to_schedule.rb +6 -0
- data/db/migrate/20170807133849_create_event_occurrences.rb +16 -0
- data/db/migrate/20170807133850_add_fields_to_event_occurrences.rb +5 -0
- data/lib/date_book.rb +40 -0
- data/lib/date_book/concerns/ability.rb +27 -0
- data/lib/date_book/concerns/acts_as_calendar.rb +29 -0
- data/lib/date_book/concerns/acts_as_event.rb +66 -0
- data/lib/date_book/concerns/acts_as_event_occurrence.rb +67 -0
- data/lib/date_book/concerns/acts_as_ownable.rb +29 -0
- data/lib/date_book/concerns/acts_as_owner.rb +18 -0
- data/lib/date_book/concerns/acts_as_schedule.rb +44 -0
- data/lib/date_book/configuration.rb +43 -0
- data/lib/date_book/engine.rb +40 -0
- data/lib/date_book/localization.rb +32 -0
- data/lib/date_book/version.rb +8 -0
- data/lib/generators/date_book/install/install_generator.rb +110 -0
- data/lib/generators/date_book/install/templates/app/models/ability.rb +16 -0
- data/lib/generators/date_book/install/templates/app/models/calendar.rb +3 -0
- data/lib/generators/date_book/install/templates/app/models/event.rb +3 -0
- data/lib/generators/date_book/install/templates/app/models/event_occurrence.rb +3 -0
- data/lib/generators/date_book/install/templates/app/models/schedule.rb +3 -0
- data/lib/generators/date_book/install/templates/config/initializers/date_book.rb +5 -0
- data/lib/generators/date_book/utils.rb +25 -0
- data/lib/tasks/date_book_tasks.rake +5 -0
- data/spec/abilities/calendar_spec.rb +39 -0
- data/spec/abilities/event_spec.rb +44 -0
- data/spec/controllers/date_book/calendars_controller_spec.rb +259 -0
- data/spec/controllers/date_book/events_controller_spec.rb +283 -0
- data/spec/dummy/Rakefile +9 -0
- data/spec/dummy/app/assets/config/manifest.js +5 -0
- data/spec/dummy/app/assets/images/.keep +0 -0
- data/spec/dummy/app/assets/javascripts/application.js +15 -0
- data/spec/dummy/app/assets/stylesheets/application.css.scss +4 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap-everything.scss +54 -0
- data/spec/dummy/app/controllers/application_controller.rb +21 -0
- data/spec/dummy/app/controllers/concerns/.keep +0 -0
- data/spec/dummy/app/helpers/application_helper.rb +4 -0
- data/spec/dummy/app/mailers/application_mailer.rb +6 -0
- data/spec/dummy/app/models/ability.rb +16 -0
- data/spec/dummy/app/models/application_record.rb +5 -0
- data/spec/dummy/app/models/calendar.rb +3 -0
- data/spec/dummy/app/models/concerns/.keep +0 -0
- data/spec/dummy/app/models/event.rb +3 -0
- data/spec/dummy/app/models/event_occurrence.rb +3 -0
- data/spec/dummy/app/models/role.rb +13 -0
- data/spec/dummy/app/models/schedule.rb +3 -0
- data/spec/dummy/app/models/user.rb +9 -0
- data/spec/dummy/app/views/application/403.html.haml +9 -0
- data/spec/dummy/app/views/application/404.html.haml +9 -0
- data/spec/dummy/app/views/layouts/application.html.haml +43 -0
- data/spec/dummy/app/views/pages/index.html.haml +1 -0
- data/spec/dummy/bin/bundle +5 -0
- data/spec/dummy/bin/rails +6 -0
- data/spec/dummy/bin/rake +6 -0
- data/spec/dummy/bin/setup +36 -0
- data/spec/dummy/bin/update +31 -0
- data/spec/dummy/config.ru +7 -0
- data/spec/dummy/config/application.rb +38 -0
- data/spec/dummy/config/boot.rb +7 -0
- data/spec/dummy/config/cable.yml +9 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +7 -0
- data/spec/dummy/config/environments/development.rb +60 -0
- data/spec/dummy/config/environments/test.rb +45 -0
- data/spec/dummy/config/initializers/application_controller_renderer.rb +7 -0
- data/spec/dummy/config/initializers/assets.rb +14 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +10 -0
- data/spec/dummy/config/initializers/bootstrap_leather.rb +9 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +7 -0
- data/spec/dummy/config/initializers/date_book.rb +5 -0
- data/spec/dummy/config/initializers/devise.rb +277 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +6 -0
- data/spec/dummy/config/initializers/high_voltage.rb +3 -0
- data/spec/dummy/config/initializers/inflections.rb +17 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/new_framework_defaults.rb +29 -0
- data/spec/dummy/config/initializers/rolify.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +5 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +17 -0
- data/spec/dummy/config/locales/devise.en.yml +64 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/puma.rb +49 -0
- data/spec/dummy/config/routes.rb +15 -0
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/config/spring.rb +8 -0
- data/spec/dummy/db/migrate/20170728171103_create_users_table.rb +7 -0
- data/spec/dummy/db/migrate/20170807134122_add_devise_to_users.rb +49 -0
- data/spec/dummy/db/migrate/20170807134128_rolify_create_roles.rb +19 -0
- data/spec/dummy/db/migrate/20170807134137_create_calendars.date_book.rb +12 -0
- data/spec/dummy/db/migrate/20170807134138_create_events.date_book.rb +21 -0
- data/spec/dummy/db/migrate/20170807134139_create_schedules.date_book.rb +26 -0
- data/spec/dummy/db/migrate/20170807134140_add_fields_to_schedule.date_book.rb +7 -0
- data/spec/dummy/db/migrate/20170807134141_create_event_occurrences.date_book.rb +17 -0
- data/spec/dummy/db/migrate/20170807134142_add_fields_to_event_occurrences.date_book.rb +6 -0
- data/spec/dummy/db/schema.rb +101 -0
- data/spec/dummy/db/seeds.rb +0 -0
- data/spec/dummy/db/seeds/calendars.seeds.rb +22 -0
- data/spec/dummy/db/seeds/events.seeds.rb +89 -0
- data/spec/dummy/db/seeds/users.seeds.rb +16 -0
- data/spec/dummy/lib/assets/.keep +0 -0
- data/spec/dummy/lib/basic_benchmark.rb +9 -0
- data/spec/dummy/log/.keep +0 -0
- data/spec/factories/calendars.rb +11 -0
- data/spec/factories/events.rb +12 -0
- data/spec/factories/roles.rb +5 -0
- data/spec/factories/users.rb +9 -0
- data/spec/features/calendars_spec.rb +185 -0
- data/spec/features/events_spec.rb +201 -0
- data/spec/helpers/date_book/calendar_helper_spec.rb +17 -0
- data/spec/helpers/date_book/events_helper_spec.rb +17 -0
- data/spec/models/calendar_spec.rb +26 -0
- data/spec/models/event_spec.rb +67 -0
- data/spec/models/role_spec.rb +5 -0
- data/spec/rails_helper.rb +116 -0
- data/spec/requests/date_book/events_spec.rb +56 -0
- data/spec/routing/date_book/calendars_routing_spec.rb +49 -0
- data/spec/routing/date_book/events_routing_spec.rb +54 -0
- data/spec/spec_helper.rb +102 -0
- data/spec/support/controller_behaviors.rb +101 -0
- data/spec/support/controller_macros.rb +25 -0
- data/spec/support/factory_girl.rb +3 -0
- data/spec/support/feature_behaviors.rb +150 -0
- data/spec/support/loaded_site.rb +5 -0
- data/spec/support/loaded_site/calendars.rb +5 -0
- data/spec/support/loaded_site/events.rb +6 -0
- data/spec/support/loaded_site/users.rb +5 -0
- data/spec/support/request_behaviors.rb +89 -0
- data/spec/support/shared_connection.rb +14 -0
- data/spec/support/utilities.rb +53 -0
- metadata +817 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
class Role < ApplicationRecord
|
|
2
|
+
has_and_belongs_to_many :users, :join_table => :users_roles
|
|
3
|
+
|
|
4
|
+
belongs_to :resource,
|
|
5
|
+
:polymorphic => true,
|
|
6
|
+
:optional => true
|
|
7
|
+
|
|
8
|
+
validates :resource_type,
|
|
9
|
+
:inclusion => { :in => Rolify.resource_types },
|
|
10
|
+
:allow_nil => true
|
|
11
|
+
|
|
12
|
+
scopify
|
|
13
|
+
end
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
class User < ApplicationRecord
|
|
2
|
+
rolify
|
|
3
|
+
acts_as_owner
|
|
4
|
+
|
|
5
|
+
# Include default devise modules. Others available are:
|
|
6
|
+
# :confirmable, :lockable, :timeoutable and :omniauthable
|
|
7
|
+
devise :database_authenticatable, :registerable,
|
|
8
|
+
:recoverable, :rememberable, :trackable, :validatable
|
|
9
|
+
end
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
!!!
|
|
2
|
+
%html{ lang: "en" }
|
|
3
|
+
%head
|
|
4
|
+
= render_title # For the title tag, including SEO content
|
|
5
|
+
= render_keywords # Defaults to what you put in the config file
|
|
6
|
+
= render_description # Can be hooked up within a mountable rails engine, too.
|
|
7
|
+
= responsive_meta_tag # If you're using the responsive features, you need this in your head
|
|
8
|
+
|
|
9
|
+
= stylesheet_link_tag 'application'
|
|
10
|
+
|
|
11
|
+
= render_head_css
|
|
12
|
+
= javascript_include_tag 'application'
|
|
13
|
+
= csrf_meta_tags
|
|
14
|
+
|
|
15
|
+
%body
|
|
16
|
+
%nav.navbar.navbar-static-top.navbar-inverse
|
|
17
|
+
.container
|
|
18
|
+
.navbar-header
|
|
19
|
+
= link_to BootstrapLeather.configuration.application_title, main_app.root_path, class: 'navbar-brand'
|
|
20
|
+
.pull-right
|
|
21
|
+
%button.menu-button.navbar-toggle.collapsed{ data: { toggle:'collapse', target:'#navbar-activities' }, type:'button' }
|
|
22
|
+
%span.sr-only
|
|
23
|
+
Toggle navigation
|
|
24
|
+
%span.sr-hidden
|
|
25
|
+
Menu
|
|
26
|
+
.collapse.navbar-collapse
|
|
27
|
+
= nav_list class: 'navbar-nav navbar-right' do
|
|
28
|
+
= nav_item 'Calendars', date_book.calendars_path
|
|
29
|
+
- if user_signed_in?
|
|
30
|
+
= nav_item 'Sign Out', main_app.destroy_user_session_path, method: :delete
|
|
31
|
+
- else
|
|
32
|
+
= nav_item 'Sign In', main_app.new_user_session_path
|
|
33
|
+
.container
|
|
34
|
+
= render_hero_unit
|
|
35
|
+
.row
|
|
36
|
+
.content
|
|
37
|
+
= render_h1 # For the h1 tag containing the title alone
|
|
38
|
+
#alert_area
|
|
39
|
+
= alert_flash_messages
|
|
40
|
+
= yield
|
|
41
|
+
|
|
42
|
+
%footer
|
|
43
|
+
= render_footer_javascript
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
- add_title 'Hello World'
|
data/spec/dummy/bin/rake
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
require 'pathname'
|
|
5
|
+
require 'fileutils'
|
|
6
|
+
include FileUtils
|
|
7
|
+
|
|
8
|
+
# path to your application root.
|
|
9
|
+
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
|
|
10
|
+
|
|
11
|
+
def system!(*args)
|
|
12
|
+
system(*args) || abort("\n== Command #{args} failed ==")
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
chdir APP_ROOT do
|
|
16
|
+
# This script is a starting point to setup your application.
|
|
17
|
+
# Add necessary setup steps to this file.
|
|
18
|
+
|
|
19
|
+
puts '== Installing dependencies =='
|
|
20
|
+
system! 'gem install bundler --conservative'
|
|
21
|
+
system('bundle check') || system!('bundle install')
|
|
22
|
+
|
|
23
|
+
# puts "\n== Copying sample files =="
|
|
24
|
+
# unless File.exist?('config/database.yml')
|
|
25
|
+
# cp 'config/database.yml.sample', 'config/database.yml'
|
|
26
|
+
# end
|
|
27
|
+
|
|
28
|
+
puts "\n== Preparing database =="
|
|
29
|
+
system! 'bin/rails db:setup'
|
|
30
|
+
|
|
31
|
+
puts "\n== Removing old logs and tempfiles =="
|
|
32
|
+
system! 'bin/rails log:clear tmp:clear'
|
|
33
|
+
|
|
34
|
+
puts "\n== Restarting application server =="
|
|
35
|
+
system! 'bin/rails restart'
|
|
36
|
+
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
require 'pathname'
|
|
5
|
+
require 'fileutils'
|
|
6
|
+
include FileUtils
|
|
7
|
+
|
|
8
|
+
# path to your application root.
|
|
9
|
+
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
|
|
10
|
+
|
|
11
|
+
def system!(*args)
|
|
12
|
+
system(*args) || abort("\n== Command #{args} failed ==")
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
chdir APP_ROOT do
|
|
16
|
+
# This script is a way to update your development environment automatically.
|
|
17
|
+
# Add necessary update steps to this file.
|
|
18
|
+
|
|
19
|
+
puts '== Installing dependencies =='
|
|
20
|
+
system! 'gem install bundler --conservative'
|
|
21
|
+
system('bundle check') || system!('bundle install')
|
|
22
|
+
|
|
23
|
+
puts "\n== Updating database =="
|
|
24
|
+
system! 'bin/rails db:migrate'
|
|
25
|
+
|
|
26
|
+
puts "\n== Removing old logs and tempfiles =="
|
|
27
|
+
system! 'bin/rails log:clear tmp:clear'
|
|
28
|
+
|
|
29
|
+
puts "\n== Restarting application server =="
|
|
30
|
+
system! 'bin/rails restart'
|
|
31
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative 'boot'
|
|
4
|
+
|
|
5
|
+
# Pick the frameworks you want:
|
|
6
|
+
require 'active_record/railtie'
|
|
7
|
+
require 'action_controller/railtie'
|
|
8
|
+
require 'action_view/railtie'
|
|
9
|
+
require 'action_mailer/railtie'
|
|
10
|
+
require 'active_job/railtie'
|
|
11
|
+
require 'action_cable/engine'
|
|
12
|
+
# require "rails/test_unit/railtie"
|
|
13
|
+
require 'sprockets/railtie'
|
|
14
|
+
|
|
15
|
+
Bundler.require(*Rails.groups)
|
|
16
|
+
require 'date_book'
|
|
17
|
+
|
|
18
|
+
module Dummy
|
|
19
|
+
class Application < Rails::Application
|
|
20
|
+
# Settings in config/environments/* take precedence over those specified
|
|
21
|
+
# here.
|
|
22
|
+
# Application configuration should go into files in config/initializers
|
|
23
|
+
# -- all .rb files in that directory are automatically loaded.
|
|
24
|
+
|
|
25
|
+
config.generators do |g|
|
|
26
|
+
g.orm :active_record
|
|
27
|
+
g.template_engine :haml
|
|
28
|
+
g.test_framework :rspec, fixture: false
|
|
29
|
+
g.stylesheets false
|
|
30
|
+
g.javascripts false
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
config.time_zone = 'America/Denver'
|
|
34
|
+
config.active_record.default_timezone = :local
|
|
35
|
+
|
|
36
|
+
config.autoload_paths << Rails.root.join('lib')
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Set up gems listed in the Gemfile.
|
|
4
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../Gemfile', __dir__)
|
|
5
|
+
|
|
6
|
+
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
|
|
7
|
+
$LOAD_PATH.unshift File.expand_path('../../../lib', __dir__)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# SQLite version 3.x
|
|
2
|
+
# gem install sqlite3
|
|
3
|
+
#
|
|
4
|
+
# Ensure the SQLite 3 gem is defined in your Gemfile
|
|
5
|
+
# gem 'sqlite3'
|
|
6
|
+
#
|
|
7
|
+
default: &default
|
|
8
|
+
adapter: sqlite3
|
|
9
|
+
pool: 5
|
|
10
|
+
timeout: 5000
|
|
11
|
+
|
|
12
|
+
development:
|
|
13
|
+
<<: *default
|
|
14
|
+
database: db/development.sqlite3
|
|
15
|
+
|
|
16
|
+
# Warning: The database defined as "test" will be erased and
|
|
17
|
+
# re-generated from your development database when you run "rake".
|
|
18
|
+
# Do not set this db to the same as development or production.
|
|
19
|
+
test:
|
|
20
|
+
<<: *default
|
|
21
|
+
database: db/test.sqlite3
|
|
22
|
+
|
|
23
|
+
production:
|
|
24
|
+
<<: *default
|
|
25
|
+
database: db/production.sqlite3
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
Rails.application.configure do
|
|
4
|
+
# Settings specified here will take precedence over those in
|
|
5
|
+
# config/application.rb.
|
|
6
|
+
|
|
7
|
+
# In the development environment your application's code is reloaded on
|
|
8
|
+
# every request. This slows down response time but is perfect for development
|
|
9
|
+
# since you don't have to restart the web server when you make code changes.
|
|
10
|
+
config.cache_classes = false
|
|
11
|
+
|
|
12
|
+
# Do not eager load code on boot.
|
|
13
|
+
config.eager_load = false
|
|
14
|
+
|
|
15
|
+
# Show full error reports.
|
|
16
|
+
config.consider_all_requests_local = true
|
|
17
|
+
|
|
18
|
+
# Enable/disable caching. By default caching is disabled.
|
|
19
|
+
if Rails.root.join('tmp/caching-dev.txt').exist?
|
|
20
|
+
config.action_controller.perform_caching = true
|
|
21
|
+
|
|
22
|
+
config.cache_store = :memory_store
|
|
23
|
+
config.public_file_server.headers = {
|
|
24
|
+
'Cache-Control' => 'public, max-age=172800'
|
|
25
|
+
}
|
|
26
|
+
else
|
|
27
|
+
config.action_controller.perform_caching = false
|
|
28
|
+
|
|
29
|
+
config.cache_store = :null_store
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Don't care if the mailer can't send.
|
|
33
|
+
config.action_mailer.raise_delivery_errors = false
|
|
34
|
+
|
|
35
|
+
config.action_mailer.perform_caching = false
|
|
36
|
+
|
|
37
|
+
# Print deprecation notices to the Rails logger.
|
|
38
|
+
config.active_support.deprecation = :log
|
|
39
|
+
|
|
40
|
+
# Raise an error on page load if there are pending migrations.
|
|
41
|
+
config.active_record.migration_error = :page_load
|
|
42
|
+
|
|
43
|
+
# Debug mode disables concatenation and preprocessing of assets.
|
|
44
|
+
# This option may cause significant delays in view rendering with a large
|
|
45
|
+
# number of complex assets.
|
|
46
|
+
config.assets.debug = true
|
|
47
|
+
|
|
48
|
+
# Suppress logger output for asset requests.
|
|
49
|
+
config.assets.quiet = true
|
|
50
|
+
|
|
51
|
+
# Raises error for missing translations
|
|
52
|
+
# config.action_view.raise_on_missing_translations = true
|
|
53
|
+
|
|
54
|
+
# Use an evented file watcher to asynchronously detect changes in source code,
|
|
55
|
+
# routes, locales, etc. This feature depends on the listen gem.
|
|
56
|
+
# config.file_watcher = ActiveSupport::EventedFileUpdateChecker
|
|
57
|
+
|
|
58
|
+
# For Devise
|
|
59
|
+
config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
|
|
60
|
+
end
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
Rails.application.configure do
|
|
4
|
+
# Settings specified here will take precedence over those in
|
|
5
|
+
# config/application.rb.
|
|
6
|
+
|
|
7
|
+
# The test environment is used exclusively to run your application's
|
|
8
|
+
# test suite. You never need to work with it otherwise. Remember that
|
|
9
|
+
# your test database is "scratch space" for the test suite and is wiped
|
|
10
|
+
# and recreated between test runs. Don't rely on the data there!
|
|
11
|
+
config.cache_classes = true
|
|
12
|
+
|
|
13
|
+
# Do not eager load code on boot. This avoids loading your whole application
|
|
14
|
+
# just for the purpose of running a single test. If you are using a tool that
|
|
15
|
+
# preloads Rails for running tests, you may have to set it to true.
|
|
16
|
+
config.eager_load = false
|
|
17
|
+
|
|
18
|
+
# Configure public file server for tests with Cache-Control for performance.
|
|
19
|
+
config.public_file_server.enabled = true
|
|
20
|
+
config.public_file_server.headers = {
|
|
21
|
+
'Cache-Control' => 'public, max-age=3600'
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
# Show full error reports and disable caching.
|
|
25
|
+
config.consider_all_requests_local = true
|
|
26
|
+
config.action_controller.perform_caching = false
|
|
27
|
+
|
|
28
|
+
# Raise exceptions instead of rendering exception templates.
|
|
29
|
+
config.action_dispatch.show_exceptions = false
|
|
30
|
+
|
|
31
|
+
# Disable request forgery protection in test environment.
|
|
32
|
+
config.action_controller.allow_forgery_protection = false
|
|
33
|
+
config.action_mailer.perform_caching = false
|
|
34
|
+
|
|
35
|
+
# Tell Action Mailer not to deliver emails to the real world.
|
|
36
|
+
# The :test delivery method accumulates sent emails in the
|
|
37
|
+
# ActionMailer::Base.deliveries array.
|
|
38
|
+
config.action_mailer.delivery_method = :test
|
|
39
|
+
|
|
40
|
+
# Print deprecation notices to the stderr.
|
|
41
|
+
config.active_support.deprecation = :stderr
|
|
42
|
+
|
|
43
|
+
# Raises error for missing translations
|
|
44
|
+
# config.action_view.raise_on_missing_translations = true
|
|
45
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Be sure to restart your server when you modify this file.
|
|
4
|
+
|
|
5
|
+
# Version of your assets, change this if you want to expire all your assets.
|
|
6
|
+
Rails.application.config.assets.version = '1.0'
|
|
7
|
+
|
|
8
|
+
# # Add additional assets to the asset load path
|
|
9
|
+
# Rails.application.config.assets.paths << Emoji.images_path
|
|
10
|
+
#
|
|
11
|
+
# # Precompile additional assets.
|
|
12
|
+
# # application.js, application.css, and all non-JS/CSS in app/assets folder
|
|
13
|
+
# # are already added.
|
|
14
|
+
# Rails.application.config.assets.precompile += %w( search.js )
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# # Be sure to restart your server when you modify this file.
|
|
3
|
+
#
|
|
4
|
+
# # You can add backtrace silencers for libraries that you're using but don't
|
|
5
|
+
# # wish to see in your backtraces.
|
|
6
|
+
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
|
|
7
|
+
#
|
|
8
|
+
# # You can also remove all the silencers if you're trying to debug a problem
|
|
9
|
+
# # that might stem from framework code.
|
|
10
|
+
# Rails.backtrace_cleaner.remove_silencers!
|