{"action":"created","issue":{"url":"https://api.github.com/repos/trailblazer/reform-rails/issues/9","repository_url":"https://api.github.com/repos/trailblazer/reform-rails","labels_url":"https://api.github.com/repos/trailblazer/reform-rails/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/trailblazer/reform-rails/issues/9/comments","events_url":"https://api.github.com/repos/trailblazer/reform-rails/issues/9/events","html_url":"https://github.com/trailblazer/reform-rails/issues/9","id":163590164,"number":9,"title":"0.1.4 makes eagar loading fail","user":{"login":"PikachuEXE","id":1018543,"avatar_url":"https://avatars.githubusercontent.com/u/1018543?v=3","gravatar_id":"","url":"https://api.github.com/users/PikachuEXE","html_url":"https://github.com/PikachuEXE","followers_url":"https://api.github.com/users/PikachuEXE/followers","following_url":"https://api.github.com/users/PikachuEXE/following{/other_user}","gists_url":"https://api.github.com/users/PikachuEXE/gists{/gist_id}","starred_url":"https://api.github.com/users/PikachuEXE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PikachuEXE/subscriptions","organizations_url":"https://api.github.com/users/PikachuEXE/orgs","repos_url":"https://api.github.com/users/PikachuEXE/repos","events_url":"https://api.github.com/users/PikachuEXE/events{/privacy}","received_events_url":"https://api.github.com/users/PikachuEXE/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-07-04T01:37:11Z","updated_at":"2016-07-04T05:05:26Z","closed_at":null,"body":"I tried to update from 0.1.2 > 0.1.4\r\n`reform` `2.2.1`\r\n\r\n### Code:\r\n```ruby\r\nrequire \"reform\"\r\nrequire \"reform/rails\"\r\n\r\nclass SomeForm < Reform::Form\r\n     include Reform::Form::ActiveModel::Validations\r\n     \r\n     # property...\r\nend\r\n```\r\nGot the same error with or without `include`\r\n\r\n\r\n### Error Log\r\n```\r\n/users/pikachuexe/projects/spacious/spacious-rails/app/controllers/api/lister_app/v1/listings/create_controller.rb:107: warning: toplevel constant ActiveModel referenced by Reform::Form::ActiveModel\r\n/users/pikachuexe/projects/spacious/spacious-rails/app/controllers/api/lister_app/v1/listings/update_controller.rb:139: warning: toplevel constant ActiveModel referenced by Reform::Form::ActiveModel\r\n/users/pikachuexe/projects/spacious/spacious-rails/app/controllers/api/lister_app/v1/my/lister_profile/update_controller.rb:148: warning: toplevel constant ActiveModel referenced by Reform::Form::ActiveModel\r\n/users/pikachuexe/.rvm/gems/ruby-2.3.1/gems/reform-2.2.1/lib/reform/validation.rb:6:in `validation_groups': undefined local variable or method `validation_group_class' for Api::ListerApp::V1::PropertyImages::CreateController::Form:Class (NameError)\r\nDid you mean?  validation_groups\r\n\tfrom /users/pikachuexe/.rvm/gems/ruby-2.3.1/gems/reform-2.2.1/lib/reform/validation.rb:13:in `validation'\r\n\tfrom /users/pikachuexe/.rvm/gems/ruby-2.3.1/gems/reform-2.2.1/lib/reform/validation.rb:19:in `validates'\r\n\tfrom /users/pikachuexe/projects/spacious/spacious-rails/app/controllers/api/lister_app/v1/property_images/create_controller.rb:138:in `<class:Form>'\r\n\tfrom /users/pikachuexe/projects/spacious/spacious-rails/app/controllers/api/lister_app/v1/property_images/create_controller.rb:134:in `<class:CreateController>'\r\n\tfrom /users/pikachuexe/projects/spacious/spacious-rails/app/controllers/api/lister_app/v1/property_images/create_controller.rb:9:in `<module:PropertyImages>'\r\n\tfrom /users/pikachuexe/projects/spacious/spacious-rails/app/controllers/api/lister_app/v1/property_images/create_controller.rb:8:in `<module:V1>'\r\n\tfrom /users/pikachuexe/projects/spacious/spacious-rails/app/controllers/api/lister_app/v1/property_images/create_controller.rb:7:in `<module:ListerApp>'\r\n\tfrom /users/pikachuexe/projects/spacious/spacious-rails/app/controllers/api/lister_app/v1/property_images/create_controller.rb:6:in `<module:Api>'\r\n\tfrom /users/pikachuexe/projects/spacious/spacious-rails/app/controllers/api/lister_app/v1/property_images/create_controller.rb:5:in `<top (required)>'\r\n\tfrom /users/pikachuexe/.rvm/gems/ruby-2.3.1/gems/activesupport-4.1.15/lib/active_support/dependencies.rb:247:in `require'\r\n\tfrom /users/pikachuexe/.rvm/gems/ruby-2.3.1/gems/activesupport-4.1.15/lib/active_support/dependencies.rb:247:in `block in require'\r\n\tfrom /users/pikachuexe/.rvm/gems/ruby-2.3.1/gems/activesupport-4.1.15/lib/active_support/dependencies.rb:232:in `load_dependency'\r\n\tfrom /users/pikachuexe/.rvm/gems/ruby-2.3.1/gems/activesupport-4.1.15/lib/active_support/dependencies.rb:247:in `require'\r\n\tfrom /users/pikachuexe/.rvm/gems/ruby-2.3.1/gems/activesupport-4.1.15/lib/active_support/dependencies.rb:348:in `require_or_load'\r\n\tfrom /users/pikachuexe/.rvm/gems/ruby-2.3.1/gems/activesupport-4.1.15/lib/active_support/dependencies.rb:307:in `depend_on'\r\n\tfrom /users/pikachuexe/.rvm/gems/ruby-2.3.1/gems/activesupport-4.1.15/lib/active_support/dependencies.rb:225:in `require_dependency'\r\n\tfrom /users/pikachuexe/.rvm/gems/ruby-2.3.1/gems/railties-4.1.15/lib/rails/engine.rb:468:in `block (2 levels) in eager_load!'\r\n\tfrom /users/pikachuexe/.rvm/gems/ruby-2.3.1/gems/railties-4.1.15/lib/rails/engine.rb:467:in `each'\r\n\tfrom /users/pikachuexe/.rvm/gems/ruby-2.3.1/gems/railties-4.1.15/lib/rails/engine.rb:467:in `block in eager_load!'\r\n\tfrom /users/pikachuexe/.rvm/gems/ruby-2.3.1/gems/railties-4.1.15/lib/rails/engine.rb:465:in `each'\r\n\tfrom /users/pikachuexe/.rvm/gems/ruby-2.3.1/gems/railties-4.1.15/lib/rails/engine.rb:465:in `eager_load!'\r\n\tfrom /users/pikachuexe/.rvm/gems/ruby-2.3.1/gems/railties-4.1.15/lib/rails/engine.rb:346:in `eager_load!'\r\n\tfrom /users/pikachuexe/.rvm/gems/ruby-2.3.1/gems/railties-4.1.15/lib/rails/application/finisher.rb:58:in `each'\r\n\tfrom /users/pikachuexe/.rvm/gems/ruby-2.3.1/gems/railties-4.1.15/lib/rails/application/finisher.rb:58:in `block in <module:Finisher>'\r\n\tfrom /users/pikachuexe/.rvm/gems/ruby-2.3.1/gems/railties-4.1.15/lib/rails/initializable.rb:30:in `instance_exec'\r\n\tfrom /users/pikachuexe/.rvm/gems/ruby-2.3.1/gems/railties-4.1.15/lib/rails/initializable.rb:30:in `run'\r\n\tfrom /users/pikachuexe/.rvm/gems/ruby-2.3.1/gems/railties-4.1.15/lib/rails/initializable.rb:55:in `block in run_initializers'\r\n\tfrom /Users/PikachuEXE/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each'\r\n\tfrom /Users/PikachuEXE/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'\r\n\tfrom /Users/PikachuEXE/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from'\r\n\tfrom /Users/PikachuEXE/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component'\r\n\tfrom /Users/PikachuEXE/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:347:in `each'\r\n\tfrom /Users/PikachuEXE/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:347:in `call'\r\n\tfrom /Users/PikachuEXE/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component'\r\n\tfrom /Users/PikachuEXE/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each'\r\n\tfrom /Users/PikachuEXE/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each'\r\n\tfrom /users/pikachuexe/.rvm/gems/ruby-2.3.1/gems/railties-4.1.15/lib/rails/initializable.rb:54:in `run_initializers'\r\n\tfrom /users/pikachuexe/.rvm/gems/ruby-2.3.1/gems/railties-4.1.15/lib/rails/application.rb:300:in `initialize!'\r\n\tfrom /users/pikachuexe/projects/spacious/spacious-rails/config/environment.rb:5:in `<top (required)>'\r\n\tfrom /users/pikachuexe/projects/spacious/spacious-rails/spec/spec_helper.rb:13:in `require'\r\n\tfrom /users/pikachuexe/projects/spacious/spacious-rails/spec/spec_helper.rb:13:in `block in <top (required)>'\r\n\tfrom /users/pikachuexe/.rvm/gems/ruby-2.3.1/gems/spork-1.0.0rc4/lib/spork.rb:24:in `prefork'\r\n\tfrom /users/pikachuexe/projects/spacious/spacious-rails/spec/spec_helper.rb:9:in `<top (required)>'\r\n\tfrom /users/pikachuexe/projects/spacious/spacious-rails/spec/rails_helper.rb:1:in `require_relative'\r\n\tfrom /users/pikachuexe/projects/spacious/spacious-rails/spec/rails_helper.rb:1:in `<top (required)>'\r\n\tfrom /users/pikachuexe/projects/spacious/spacious-rails/spec/controllers/users/omniauth_callbacks_controller_spec.rb:1:in `require'\r\n\tfrom /users/pikachuexe/projects/spacious/spacious-rails/spec/controllers/users/omniauth_callbacks_controller_spec.rb:1:in `<top (required)>'\r\n\tfrom /users/pikachuexe/.rvm/gems/ruby-2.3.1/gems/rspec-core-3.5.0/lib/rspec/core/configuration.rb:1435:in `load'\r\n\tfrom /users/pikachuexe/.rvm/gems/ruby-2.3.1/gems/rspec-core-3.5.0/lib/rspec/core/configuration.rb:1435:in `block in load_spec_files'\r\n\tfrom /users/pikachuexe/.rvm/gems/ruby-2.3.1/gems/rspec-core-3.5.0/lib/rspec/core/configuration.rb:1433:in `each'\r\n\tfrom /users/pikachuexe/.rvm/gems/ruby-2.3.1/gems/rspec-core-3.5.0/lib/rspec/core/configuration.rb:1433:in `load_spec_files'\r\n\tfrom /users/pikachuexe/.rvm/gems/ruby-2.3.1/gems/rspec-core-3.5.0/lib/rspec/core/runner.rb:100:in `setup'\r\n\tfrom /users/pikachuexe/.rvm/gems/ruby-2.3.1/gems/rspec-core-3.5.0/lib/rspec/core/runner.rb:86:in `run'\r\n\tfrom /users/pikachuexe/.rvm/gems/ruby-2.3.1/gems/rspec-core-3.5.0/lib/rspec/core/runner.rb:71:in `run'\r\n\tfrom /users/pikachuexe/.rvm/gems/ruby-2.3.1/gems/rspec-core-3.5.0/lib/rspec/core/runner.rb:45:in `invoke'\r\n\tfrom /users/pikachuexe/.rvm/gems/ruby-2.3.1/gems/rspec-core-3.5.0/exe/rspec:4:in `<top (required)>'\r\n\tfrom /users/pikachuexe/.rvm/gems/ruby-2.3.1/bin/rspec:22:in `load'\r\n\tfrom /users/pikachuexe/.rvm/gems/ruby-2.3.1/bin/rspec:22:in `<top (required)>'\r\n\tfrom -e:1:in `load'\r\n\tfrom -e:1:in `<main>'\r\n```"},"comment":{"url":"https://api.github.com/repos/trailblazer/reform-rails/issues/comments/230205689","html_url":"https://github.com/trailblazer/reform-rails/issues/9#issuecomment-230205689","issue_url":"https://api.github.com/repos/trailblazer/reform-rails/issues/9","id":230205689,"user":{"login":"PikachuEXE","id":1018543,"avatar_url":"https://avatars.githubusercontent.com/u/1018543?v=3","gravatar_id":"","url":"https://api.github.com/users/PikachuEXE","html_url":"https://github.com/PikachuEXE","followers_url":"https://api.github.com/users/PikachuEXE/followers","following_url":"https://api.github.com/users/PikachuEXE/following{/other_user}","gists_url":"https://api.github.com/users/PikachuEXE/gists{/gist_id}","starred_url":"https://api.github.com/users/PikachuEXE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PikachuEXE/subscriptions","organizations_url":"https://api.github.com/users/PikachuEXE/orgs","repos_url":"https://api.github.com/users/PikachuEXE/repos","events_url":"https://api.github.com/users/PikachuEXE/events{/privacy}","received_events_url":"https://api.github.com/users/PikachuEXE/received_events","type":"User","site_admin":false},"created_at":"2016-07-04T05:05:26Z","updated_at":"2016-07-04T05:05:26Z","body":"Sure please see below\r\n\r\nMain line for eager load:\r\n```ruby\r\nconfig.eager_load = true\r\n```\r\n\r\n#### `config/application.rb`\r\n```ruby\r\nrequire File.expand_path('../boot', __FILE__)\r\n\r\n# Pick the frameworks you want:\r\nrequire \"active_record/railtie\"\r\nrequire \"action_controller/railtie\"\r\nrequire \"action_mailer/railtie\"\r\nrequire \"sprockets/railtie\"\r\n# require \"rails/test_unit/railtie\"\r\n\r\nif defined?(Bundler)\r\n  # Require the gems listed in Gemfile, including any gems\r\n  # you've limited to :test, :development, or :production.\r\n  Bundler.require(:default, Rails.env)\r\nend\r\n\r\nmodule Spacious\r\n  class Application < Rails::Application\r\n    # Settings in config/environments/* take precedence over those specified here.\r\n    # Application configuration should go into files in config/initializers\r\n    # -- all .rb files in that directory are automatically loaded.\r\n\r\n    # Make our web page gzipped\r\n    config.middleware.insert_before(ActionDispatch::Static, Rack::Deflater)\r\n\r\n    # Concerns (Already in Rails 4)\r\n    config.autoload_paths += %W(\r\n      #{config.root}/app/controllers/concerns\r\n      #{config.root}/app/models/concerns\r\n      #{config.root}/app/concepts\r\n    )\r\n\r\n    # Force SSL to be used\r\n    ssl_enforcer_options = {\r\n      except_agents: [/Baiduspider/i, /MSIE [6|7|8]/i],\r\n      ignore: [%r|/assets|i, '/robots.txt', %r|/api|, %r|/health_check|],\r\n      # We want to enforce HTTP to HTTPS for some domains\r\n      # We DON't want to enforce HTTPS to HTTP for other domains\r\n      strict: false,\r\n      # DON't enable this until you know what is this\r\n      hsts: nil,\r\n    }\r\n    if ENV[\"HTTP_PORT\"]\r\n      ssl_enforcer_options.merge!(http_port: ENV[\"HTTP_PORT\"])\r\n    end\r\n    if ENV[\"HTTPS_PORT\"]\r\n      ssl_enforcer_options.merge!(https_port: ENV[\"HTTPS_PORT\"])\r\n    end\r\n    config.middleware.use \"Rack::SslEnforcerCustomized\", ssl_enforcer_options\r\n\r\n    # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.\r\n    # Run \"rake -D time\" for a list of tasks for finding time zone names. Default is UTC.\r\n    config.time_zone = 'Hong Kong'\r\n\r\n    # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.\r\n    # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]\r\n    config.i18n.default_locale = :en\r\n    # For now we only have en\r\n    config.i18n.available_locales = [:en, :'zh-TW', :'zh-CN', :'zh-HK']\r\n    # Enforce to check if assigned locale is included in available_locales\r\n    config.i18n.enforce_available_locales = true\r\n\r\n    # Configure the default encoding used in templates for Ruby 1.9.\r\n    config.encoding = \"utf-8\"\r\n\r\n    # Enable escaping HTML in JSON.\r\n    config.active_support.escape_html_entities_in_json = true\r\n\r\n    # Rescue error with our app\r\n    config.exceptions_app = self.routes\r\n\r\n    # ActionMailer template root path\r\n    ActionMailer::Base.prepend_view_path(Rails.root.join(\"app/views/mailers\"))\r\n\r\n    # Use SQL instead of Active Record's schema dumper when creating the database.\r\n    # This is necessary if your schema can't be completely dumped by the schema dumper,\r\n    # like if you have constraints or database-specific column types\r\n    # config.active_record.schema_format = :sql\r\n\r\n    # Version of your assets, change this if you want to expire all your assets\r\n    config.assets.version = '1.0'\r\n\r\n    # was turned off to resolve issue with heroku precompile\r\n    #   http://devcenter.heroku.com/articles/rails3x-asset-pipeline-cedar\r\n    # now turned on as we use `heroku labs:enable user-env-compile`\r\n    config.assets.initialize_on_precompile = true\r\n\r\n    # assets;\r\n    config.assets.precompile += [\r\n      # rails admin needs these\r\n      \"rails_admin/rails_admin.js\",\r\n      \"rails_admin/rails_admin.css\",\r\n      \"rails_admin/jquery.colorpicker.js\",\r\n      \"rails_admin/jquery.colorpicker.css\",\r\n\r\n      # Script run in head\r\n      \"html5shiv.js\",\r\n      \"head.js\",\r\n    ]\r\n    # Fix for sprocket-rails\r\n    # http://blog.xdite.net/posts/2014/01/29/rails4-asset-mess\r\n    # https://github.com/rails/rails/pull/7968\r\n    config.assets.precompile += %w(*.png *.jpg *.jpeg *.gif)\r\n\r\n    # Since `sprockets-rails` 2.1.0\r\n    config.assets.raise_runtime_errors = true\r\n\r\n    # we don't want too much boilerplate\r\n    config.generators.template_engine :haml\r\n    config.generators.helper = false\r\n    config.generators.assets = false\r\n    config.generators.test_framework :rspec, view_specs: false\r\n    config.generators.fixture_replacement :factory_girl, dir: 'spec/factories'\r\n    config.generators.orm :active_record\r\n\r\n    config.log_level = (\r\n          [\r\n              (ENV![:LOG_LEVEL] || ::Rails.application.config.log_level).to_s.upcase,\r\n              \"INFO\",\r\n          ] & %w[DEBUG INFO WARN ERROR FATAL UNKNOWN]\r\n        ).compact.first\r\n\r\n\r\n    ### Redis\r\n    config.redis_url = ENV![:REDIS_URL]\r\n\r\n    # Caching\r\n    config.use_memcache = false\r\n    config.use_redis_for_caching = false\r\n  end\r\nend\r\n\r\n```\r\n\r\n#### `config/environments/development.rb`\r\n```ruby\r\nRails.application.class.configure do\r\n  # Settings specified here will take precedence over those in config/application.rb\r\n\r\n  # In the development environment your application's code is reloaded on\r\n  # every request. This slows down response time but is perfect for development\r\n  # since you don't have to restart the web server when you make code changes.\r\n  config.cache_classes = false\r\n\r\n  # Do not eager load code on boot.\r\n  config.eager_load = true\r\n\r\n  # Show full error reports and disable caching\r\n  config.consider_all_requests_local       = true\r\n  config.action_controller.perform_caching = true\r\n\r\n  # Print deprecation notices to the Rails logger\r\n  config.active_support.deprecation = :log\r\n\r\n  # Use a different cache store based on memcached is running or not\r\n  config.memcache_servers = nil\r\n  config.dalli_client_options = {\r\n    namespace: Rails.application.class.parent_name,\r\n    expires_in: 1.day,\r\n    compress: true,\r\n  }\r\n  begin\r\n    # check if memcached is running; if it is, use that instead of the default memory cache\r\n    Timeout.timeout(0.5) { TCPSocket.open(\"localhost\", 11211) { } }\r\n\r\n    config.memcache_servers = %w(localhost:11211)\r\n    config.use_memcache = true\r\n    config.cache_store = :dalli_store, config.memcache_servers, config.dalli_client_options\r\n\r\n    $stderr.puts \"Using memcached on localhost:11211\"\r\n  rescue StandardError\r\n    $stderr.puts \"memcached not running, caching to memory\"\r\n  end\r\n\r\n  # Do not compress assets\r\n  config.assets.compress = false\r\n\r\n  # Expands the lines which load the assets\r\n  config.assets.debug = true\r\n\r\n  # Raise error for missing asset\r\n  config.assets.raise_runtime_errors = true\r\n\r\n  ### Email related\r\n  ## Send email to mailcatcher\r\n  config.action_mailer.delivery_method = :smtp\r\n  config.action_mailer.smtp_settings = {\r\n      address:        'localhost',\r\n      port:           1025,\r\n  }\r\n  # change to true to allow email to be sent during development\r\n  config.action_mailer.perform_deliveries = true\r\n  config.action_mailer.raise_delivery_errors = true\r\n  config.action_mailer.default charset: \"utf-8\"\r\n  config.action_mailer.default_url_options = {\r\n      host: AppConfig.default_domain,\r\n      port: 3000,\r\n  }\r\n\r\n\r\n  ### Development tools\r\n  BetterErrors.use_pry!\r\n  AwesomePrint.defaults = { plain: true }\r\n\r\n  # Raises error for missing translations\r\n  config.action_view.raise_on_missing_translations = true\r\nend\r\n```"}}
{"actor":{"display_login":"PikachuEXE"}}