Skip to main content

Populate platforms to be able to see tutorial pages

  • Make sure platforms table is present and it has columns name(:varchar), display_name(:varchar).

  • Run ap Platform to check

  • If the table exists but the name is shown as integer, run (in a new console) psql and drop table platforms;

  • Then create table using directions below

  • If it doesn't exist, run rails console, then copy and paste -

ActiveRecord::Migration.create_table :platforms, id: false do |t| t.string :name, primary_key: true t.string :display_name t.timestamps end

  • Next, populate platforms table by running rake db:migrate:redo VERSION=20190425003308 in terminal

  • Now, if you visit https://localhost:3000/tutorials page, you should be able to see - Screen Shot 2019-09-30 at 12.00.56 PM.png

  • If the list is not updated, in rails console try deleting caches by typing Fallback::Cache.delete("platform_names_display_hash"),

  • Then run

   Fallback::Cache.fetch("platform_names_display_hash", expires_in: ENV['CACHE_TTL'].to_i.hours) do
Platform.pluck(:name, :display_name).to_h
end

and then try refreshing the page