From eb281b61657a55fa3913804bc97ad5d4e29f3018 Mon Sep 17 00:00:00 2001 From: Ashley Sullins Date: Sun, 2 Oct 2016 22:24:52 -0500 Subject: [PATCH 1/3] Add archetype to character information --- app/controllers/characters_controller.rb | 2 +- app/models/character.rb | 2 +- app/views/content/_form.html.erb | 6 ++ config/locales/en.yml | 86 +++++++++++++++++++ ...161003000856_add_archetype_to_character.rb | 5 ++ db/schema.rb | 3 +- 6 files changed, 101 insertions(+), 3 deletions(-) create mode 100644 db/migrate/20161003000856_add_archetype_to_character.rb diff --git a/app/controllers/characters_controller.rb b/app/controllers/characters_controller.rb index fd498e98..d4a650a0 100644 --- a/app/controllers/characters_controller.rb +++ b/app/controllers/characters_controller.rb @@ -11,7 +11,7 @@ class CharactersController < ContentController def content_param_list [ :universe_id, :user_id, - :name, :age, :role, :gender, :age, :height, :weight, :haircolor, + :name, :age, :role, :gender, :age, :archetype, :height, :weight, :haircolor, :facialhair, :eyecolor, :race, :skintone, :bodytype, :identmarks, :religion, :politics, :prejudices, :occupation, :pets, :mannerisms, :birthday, :education, :background, diff --git a/app/models/character.rb b/app/models/character.rb index 7d5a28dc..9c8d92a6 100644 --- a/app/models/character.rb +++ b/app/models/character.rb @@ -51,7 +51,7 @@ class Character < ActiveRecord::Base { overview: { icon: 'info', - attributes: %w(name role gender age universe_id) + attributes: %w(name role gender age archetype universe_id) }, looks: { icon: 'face', diff --git a/app/views/content/_form.html.erb b/app/views/content/_form.html.erb index 4839d943..48dc2094 100644 --- a/app/views/content/_form.html.erb +++ b/app/views/content/_form.html.erb @@ -67,6 +67,12 @@ <% through_class = content.class.reflect_on_association(attribute).options[:through].to_s %> <%= render 'content/form/relation_input', f: f, attribute: attribute, relation: through_class %> + <% elsif attribute == 'archetype' %> +
+ <%= f.label attribute %>
+ <%= f.select attribute, options_for_select(t('archetypes'), selected: f.object.archetype), include_blank: true %> +
+ <% elsif attribute == 'universe_id' %>
<%= f.label attribute %>
diff --git a/config/locales/en.yml b/config/locales/en.yml index d64e73e5..e0a564bd 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -539,6 +539,92 @@ en: - Jet black - Raven black + archetypes: + - Anthropomorphic Personification + - Anti-Hero + - Archmage + - Barefoot Sage + - Big Fun + - Blind Seer + - Blue-Collar Warlock + - Bruiser with a Soft Center + - The Champion + - The Chosen One + - The Chooser of The One + - Classic Villain + - The Cynic + - The Dragonslayer + - The Drunken Sailor + - Dumb Muscle + - Eccentric Mentor + - Enigmatic Empowering Entity + - Evil Overlord + - The Fair Folk + - Father Neptune + - Ferryman + - The Fool + - Fool for Love + - Gentle Giant + - The Good King + - Granny Classic + - The Grotesque + - Herald + - Heroic Archetype + - Heroic Wannabe + - The High Queen + - Higher Self + - The Hunter + - Ideal Hero + - The Idealist + - Ineffectual Loner + - The Kirk + - The Klutz + - Knight in Shining Armor + - Lady and Knight + - Loser Archetype + - Lovable Rogue + - Magical Barefooter + - Mary Sue + - The McCoy + - Mentor + - Messianic + - Mixed + - Mock Millionaire + - Modern Major General + - My Girl Back Home + - Obstructive Bureaucrat + - Oedipus Complex + - Old Soldier + - The Paladin + - The Patriarch + - Person of Mass Destruction + - The Pollyanna + - Powers That Be + - Prince Charming + - Princess Classic + - A Protagonist Shall Lead Them + - Rebel Leader + - Rebellious Spirit + - Reluctant Monster + - Satanic Archetype + - Seeker Archetype + - Shadow Archetype + - Shapeshifter + - The Spock + - Star-Crossed Lovers + - The Storyteller + - Threshold Guardians + - Turn Coat + - The Trickster + - Visitor + - Wicked Stepmother + - Wicked Witch + - Wizard Classic + - Wolf Man + - World's Best Warrior + - World's Most Beautiful Woman + - World's Strongest Man + location_name_prefixes: - New - Los diff --git a/db/migrate/20161003000856_add_archetype_to_character.rb b/db/migrate/20161003000856_add_archetype_to_character.rb new file mode 100644 index 00000000..6aa67993 --- /dev/null +++ b/db/migrate/20161003000856_add_archetype_to_character.rb @@ -0,0 +1,5 @@ +class AddArchetypeToCharacter < ActiveRecord::Migration + def change + add_column :characters, :archetype, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index a7dc2543..05e6926c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20160922204317) do +ActiveRecord::Schema.define(version: 20161003000856) do create_table "archenemyships", force: :cascade do |t| t.integer "user_id" @@ -80,6 +80,7 @@ ActiveRecord::Schema.define(version: 20160922204317) do t.datetime "created_at" t.datetime "updated_at" t.string "privacy" + t.string "archetype" end create_table "childrenships", force: :cascade do |t| From 8c6ba6b9385357d3760086a0d865c3c5142880da Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Mon, 3 Oct 2016 23:53:27 +0200 Subject: [PATCH 2/3] Revert "Add emergency maintenance notice" This reverts commit f82ccc379ef8d3153d32d99605ccf8331e115fd0. --- app/views/layouts/application.html.erb | 8 -------- 1 file changed, 8 deletions(-) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 7c124b80..00353fa5 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -20,14 +20,6 @@
-
-
-

- Important notice: Notebook.ai will be going down temporarily for emergency maintenance to upgrade the database at 22:00 UTC. - This maintenance should last no longer than 1 hour. -

-
-
<%= yield %> From 44ee57edfb8cc6d53e96dcd9d27f82d004e3b823 Mon Sep 17 00:00:00 2001 From: Donovan Hernandez Date: Mon, 3 Oct 2016 17:14:11 -0500 Subject: [PATCH 3/3] Add scout_apm gem --- Gemfile | 1 + Gemfile.lock | 2 ++ 2 files changed, 3 insertions(+) diff --git a/Gemfile b/Gemfile index e7de37c9..194234af 100644 --- a/Gemfile +++ b/Gemfile @@ -44,6 +44,7 @@ gem 'slack-notifier' group :production do gem 'rails_12factor' gem 'uglifier', '>= 1.3.0' + gem 'scout_apm' end group :test, :production do diff --git a/Gemfile.lock b/Gemfile.lock index 4ec7397e..d9d8eb26 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -286,6 +286,7 @@ GEM sprockets (>= 2.8, < 4.0) sprockets-rails (>= 2.0, < 4.0) tilt (>= 1.1, < 3) + scout_apm (2.1.12) selenium-webdriver (2.53.4) childprocess (~> 0.5) rubyzip (~> 1.0) @@ -370,6 +371,7 @@ DEPENDENCIES rubocop ruby-prof (= 0.15.9) sass-rails + scout_apm selenium-webdriver serendipitous! shoulda-matchers (~> 3.1)