Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ActiveAdmin migrations are in local time, not UTC #1464

Closed
jessicalevine opened this issue Jul 3, 2012 · 0 comments
Closed

ActiveAdmin migrations are in local time, not UTC #1464

jessicalevine opened this issue Jul 3, 2012 · 0 comments

Comments

@jessicalevine
Copy link

When using rails generate active_admin:install, ActiveAdmin migrations are done with local time, instead of UTC, as Rails migrations are supposed to. See Rails Docs

You can see the error in the console output here (running ActiveAdmin 0.4.4):

jordan@air:~/dev/tester$ rails g active_admin:install
      invoke  devise
    generate    devise:install
      create    config/initializers/devise.rb
      create    config/locales/devise.en.yml
  ===============================================================================

Some setup you must do manually if you haven't yet:

  1. Ensure you have defined default url options in your environments files. Here 
     is an example of default_url_options appropriate for a development environment 
     in config/environments/development.rb:

       config.action_mailer.default_url_options = { :host => 'localhost:3000' }

     In production, :host should be set to the actual host of your application.

  2. Ensure you have defined root_url to *something* in your config/routes.rb.
     For example:

       root :to => "home#index"

  3. Ensure you have flash messages in app/views/layouts/application.html.erb.
     For example:

       <p class="notice"><%= notice %></p>
       <p class="alert"><%= alert %></p>

  4. If you are deploying Rails 3.1 on Heroku, you may want to set:

       config.assets.initialize_on_precompile = false

     On config/application.rb forcing your application to not access the DB
     or load models when precompiling your assets.

===============================================================================
      invoke    active_record
      create      db/migrate/20120703214047_devise_create_admin_users.rb
      create      app/models/admin_user.rb
      invoke      test_unit
      create        test/unit/admin_user_test.rb
      create        test/fixtures/admin_users.yml
      insert      app/models/admin_user.rb
       route    devise_for :admin_users
        gsub    app/models/admin_user.rb
        gsub    config/routes.rb
      insert    db/migrate/20120703214047_devise_create_admin_users.rb
      create  config/initializers/active_admin.rb
      create  app/admin
      create  app/admin/dashboards.rb
       route  ActiveAdmin.routes(self)
    generate  active_admin:assets
      create  app/assets/javascripts/active_admin.js
      create  app/assets/stylesheets/active_admin.css.scss
      create  db/migrate/20120703174049_create_admin_notes.rb
      create  db/migrate/20120703174050_move_admin_notes_to_comments.rb

Migrations from Devise properly use UTC, but ActiveAdmin migrations are off by 4 hours (which is the exact offset of EDT, my timezone).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants