{"action":"created","issue":{"url":"https://api.github.com/repos/assaf/vanity/issues/272","labels_url":"https://api.github.com/repos/assaf/vanity/issues/272/labels{/name}","comments_url":"https://api.github.com/repos/assaf/vanity/issues/272/comments","events_url":"https://api.github.com/repos/assaf/vanity/issues/272/events","html_url":"https://github.com/assaf/vanity/pull/272","id":104968568,"number":272,"title":"VanityConversion model \"alternative\" attr_accessible","user":{"login":"mikem836","id":12513,"avatar_url":"https://avatars.githubusercontent.com/u/12513?v=3","gravatar_id":"","url":"https://api.github.com/users/mikem836","html_url":"https://github.com/mikem836","followers_url":"https://api.github.com/users/mikem836/followers","following_url":"https://api.github.com/users/mikem836/following{/other_user}","gists_url":"https://api.github.com/users/mikem836/gists{/gist_id}","starred_url":"https://api.github.com/users/mikem836/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikem836/subscriptions","organizations_url":"https://api.github.com/users/mikem836/orgs","repos_url":"https://api.github.com/users/mikem836/repos","events_url":"https://api.github.com/users/mikem836/events{/privacy}","received_events_url":"https://api.github.com/users/mikem836/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-04T20:59:15Z","updated_at":"2015-09-08T16:53:16Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/assaf/vanity/pulls/272","html_url":"https://github.com/assaf/vanity/pull/272","diff_url":"https://github.com/assaf/vanity/pull/272.diff","patch_url":"https://github.com/assaf/vanity/pull/272.patch"},"body":"The \"alternative\" attribute appears to be mass assigned, so it needs to be attr_accessible."},"comment":{"url":"https://api.github.com/repos/assaf/vanity/issues/comments/138631858","html_url":"https://github.com/assaf/vanity/pull/272#issuecomment-138631858","issue_url":"https://api.github.com/repos/assaf/vanity/issues/272","id":138631858,"user":{"login":"mikem836","id":12513,"avatar_url":"https://avatars.githubusercontent.com/u/12513?v=3","gravatar_id":"","url":"https://api.github.com/users/mikem836","html_url":"https://github.com/mikem836","followers_url":"https://api.github.com/users/mikem836/followers","following_url":"https://api.github.com/users/mikem836/following{/other_user}","gists_url":"https://api.github.com/users/mikem836/gists{/gist_id}","starred_url":"https://api.github.com/users/mikem836/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikem836/subscriptions","organizations_url":"https://api.github.com/users/mikem836/orgs","repos_url":"https://api.github.com/users/mikem836/repos","events_url":"https://api.github.com/users/mikem836/events{/privacy}","received_events_url":"https://api.github.com/users/mikem836/received_events","type":"User","site_admin":false},"created_at":"2015-09-08T16:53:16Z","updated_at":"2015-09-08T16:53:16Z","body":"It's breaking in VanityExperiment#increment_conversion when using the ActiveRecord adapter. Sorry for the lack of a test, but I can't get the appraisals working right now. We are using the protected_attributes gem with Rails 4.2, so it's likely an edge case with our setup.\r\n\r\nHere's a stack trace...\r\n\r\nprotected_attributes (1.1.0) lib/active_model/mass_assignment_security/sanitizer.rb:60:in `process_removed_attributes'\r\nprotected_attributes (1.1.0) lib/active_model/mass_assignment_security/sanitizer.rb:10:in `sanitize'\r\nprotected_attributes (1.1.0) lib/active_model/mass_assignment_security.rb:355:in `sanitize_for_mass_assignment'\r\nprotected_attributes (1.1.0) lib/active_record/mass_assignment_security/attribute_assignment.rb:58:in `assign_attributes'\r\nprotected_attributes (1.1.0) lib/active_record/mass_assignment_security/core.rb:8:in `init_attributes'\r\nactiverecord (4.2.3) lib/active_record/core.rb:281:in `initialize'\r\nactiverecord (4.2.3) lib/active_record/inheritance.rb:61:in `new'\r\nactiverecord (4.2.3) lib/active_record/inheritance.rb:61:in `new'\r\nprotected_attributes (1.1.0) lib/active_record/mass_assignment_security/reflection.rb:6:in `build_association'\r\nprotected_attributes (1.1.0) lib/active_record/mass_assignment_security/associations.rb:5:in `build_record'\r\nprotected_attributes (1.1.0) lib/active_record/mass_assignment_security/associations.rb:42:in `block in create_record'\r\nactiverecord (4.2.3) lib/active_record/associations/collection_association.rb:183:in `block in transaction'\r\nactiverecord (4.2.3) lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction'\r\nactiverecord (4.2.3) lib/active_record/connection_adapters/abstract/transaction.rb:184:in `within_new_transaction'\r\nactiverecord (4.2.3) lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction'\r\nactiverecord (4.2.3) lib/active_record/transactions.rb:220:in `transaction'\r\nactiverecord (4.2.3) lib/active_record/associations/collection_association.rb:182:in `transaction'\r\nprotected_attributes (1.1.0) lib/active_record/mass_assignment_security/associations.rb:41:in `create_record'\r\nprotected_attributes (1.1.0) lib/active_record/mass_assignment_security/associations.rb:26:in `create'\r\nactiverecord (4.2.3) lib/active_record/association_relation.rb:22:in `block in create'\r\nactiverecord (4.2.3) lib/active_record/relation.rb:302:in `scoping'\r\nactiverecord (4.2.3) lib/active_record/association_relation.rb:22:in `create'\r\nactiverecord (4.2.3) lib/active_record/relation.rb:213:in `find_or_create_by'\r\nactiverecord (4.2.3) lib/active_record/querying.rb:6:in `find_or_create_by'\r\n/Users/mikemilner/.rvm/gems/ruby-2.2.2/bundler/gems/vanity-bd3fa85f713d/lib/vanity/adapters/active_record_adapter.rb:23:in `rails_agnostic_find_or_create_by'\r\nactiverecord (4.2.3) lib/active_record/relation/delegation.rb:94:in `public_send'\r\nactiverecord (4.2.3) lib/active_record/relation/delegation.rb:94:in `block in method_missing'\r\nactiverecord (4.2.3) lib/active_record/associations/collection_proxy.rb:874:in `block in scoping'\r\nactiverecord (4.2.3) lib/active_record/relation.rb:302:in `scoping'\r\nactiverecord (4.2.3) lib/active_record/associations/collection_proxy.rb:874:in `scoping'\r\nactiverecord (4.2.3) lib/active_record/relation/delegation.rb:94:in `method_missing'\r\n/Users/mikemilner/.rvm/gems/ruby-2.2.2/bundler/gems/vanity-bd3fa85f713d/lib/vanity/adapters/active_record_adapter.rb:73:in `increment_conversion'\r\n/Users/mikemilner/.rvm/gems/ruby-2.2.2/bundler/gems/vanity-bd3fa85f713d/lib/vanity/adapters/active_record_adapter.rb:263:in `ab_add_conversion'\r\n/Users/mikemilner/.rvm/gems/ruby-2.2.2/bundler/gems/vanity-bd3fa85f713d/lib/vanity/experiment/ab_test.rb:470:in `track!'\r\n/Users/mikemilner/.rvm/gems/ruby-2.2.2/bundler/gems/vanity-bd3fa85f713d/lib/vanity/metric/base.rb:238:in `call'\r\n/Users/mikemilner/.rvm/gems/ruby-2.2.2/bundler/gems/vanity-bd3fa85f713d/lib/vanity/metric/base.rb:238:in `block in call_hooks'\r\n/Users/mikemilner/.rvm/gems/ruby-2.2.2/bundler/gems/vanity-bd3fa85f713d/lib/vanity/metric/base.rb:237:in `each'\r\n/Users/mikemilner/.rvm/gems/ruby-2.2.2/bundler/gems/vanity-bd3fa85f713d/lib/vanity/metric/base.rb:237:in `call_hooks'\r\n/Users/mikemilner/.rvm/gems/ruby-2.2.2/bundler/gems/vanity-bd3fa85f713d/lib/vanity/metric/base.rb:141:in `track!'\r\n/Users/mikemilner/.rvm/gems/ruby-2.2.2/bundler/gems/vanity-bd3fa85f713d/lib/vanity/playground.rb:190:in `track!'\r\n/Users/mikemilner/.rvm/gems/ruby-2.2.2/bundler/gems/vanity-bd3fa85f713d/lib/vanity/helpers.rb:67:in `track!'\r\napp/controllers/law_simplified/admin_request_questions_controller.rb:15:in `index'\r\nactionpack (4.2.3) lib/action_controller/metal/implicit_render.rb:4:in `send_action'\r\nactionpack (4.2.3) lib/abstract_controller/base.rb:198:in `process_action'\r\nactionpack (4.2.3) lib/action_controller/metal/rendering.rb:10:in `process_action'\r\nactionpack (4.2.3) lib/abstract_controller/callbacks.rb:20:in `block in process_action'\r\nactivesupport (4.2.3) lib/active_support/callbacks.rb:115:in `call'\r\nactivesupport (4.2.3) lib/active_support/callbacks.rb:115:in `call'\r\nactivesupport (4.2.3) lib/active_support/callbacks.rb:553:in `block (2 levels) in compile'\r\nactivesupport (4.2.3) lib/active_support/callbacks.rb:503:in `call'\r\nactivesupport (4.2.3) lib/active_support/callbacks.rb:503:in `call'\r\nactivesupport (4.2.3) lib/active_support/callbacks.rb:496:in `block (2 levels) in around'\r\nactivesupport (4.2.3) lib/active_support/callbacks.rb:311:in `call'\r\nactivesupport (4.2.3) lib/active_support/callbacks.rb:311:in `block (2 levels) in halting'\r\n/Users/mikemilner/.rvm/gems/ruby-2.2.2/bundler/gems/vanity-bd3fa85f713d/lib/vanity/frameworks/rails.rb:117:in `vanity_context_filter'\r\nactivesupport (4.2.3) lib/active_support/callbacks.rb:430:in `block in make_lambda'\r\nactivesupport (4.2.3) lib/active_support/callbacks.rb:310:in `call'\r\nactivesupport (4.2.3) lib/active_support/callbacks.rb:310:in `block in halting'\r\nactivesupport (4.2.3) lib/active_support/callbacks.rb:495:in `call'\r\nactivesupport (4.2.3) lib/active_support/callbacks.rb:495:in `block in around'\r\nactivesupport (4.2.3) lib/active_support/callbacks.rb:503:in `call'\r\nactivesupport (4.2.3) lib/active_support/callbacks.rb:503:in `call'\r\nactivesupport (4.2.3) lib/active_support/callbacks.rb:88:in `run_callbacks'\r\nactionpack (4.2.3) lib/abstract_controller/callbacks.rb:19:in `process_action'\r\nactionpack (4.2.3) lib/action_controller/metal/rescue.rb:29:in `process_action'\r\nactionpack (4.2.3) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'\r\nactivesupport (4.2.3) lib/active_support/notifications.rb:164:in `block in instrument'\r\nactivesupport (4.2.3) lib/active_support/notifications/instrumenter.rb:20:in `instrument'\r\nactivesupport (4.2.3) lib/active_support/notifications.rb:164:in `instrument'\r\nactionpack (4.2.3) lib/action_controller/metal/instrumentation.rb:30:in `process_action'\r\nactionpack (4.2.3) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'\r\nactiverecord (4.2.3) lib/active_record/railties/controller_runtime.rb:18:in `process_action'\r\nactionpack (4.2.3) lib/abstract_controller/base.rb:137:in `process'\r\nactionview (4.2.3) lib/action_view/rendering.rb:30:in `process'\r\nactionpack (4.2.3) lib/action_controller/metal.rb:196:in `dispatch'\r\nactionpack (4.2.3) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'\r\nactionpack (4.2.3) lib/action_controller/metal.rb:237:in `block in action'\r\nactionpack (4.2.3) lib/action_dispatch/routing/route_set.rb:76:in `call'\r\nactionpack (4.2.3) lib/action_dispatch/routing/route_set.rb:76:in `dispatch'\r\nactionpack (4.2.3) lib/action_dispatch/routing/route_set.rb:45:in `serve'\r\nactionpack (4.2.3) lib/action_dispatch/journey/router.rb:43:in `block in serve'\r\nactionpack (4.2.3) lib/action_dispatch/journey/router.rb:30:in `each'\r\nactionpack (4.2.3) lib/action_dispatch/journey/router.rb:30:in `serve'\r\nactionpack (4.2.3) lib/action_dispatch/routing/route_set.rb:821:in `call'\r\nomniauth (1.2.2) lib/omniauth/strategy.rb:186:in `call!'\r\nomniauth (1.2.2) lib/omniauth/strategy.rb:164:in `call'\r\nomniauth (1.2.2) lib/omniauth/builder.rb:59:in `call'\r\nmeta_request (0.3.4) lib/meta_request/middlewares/app_request_handler.rb:13:in `call'\r\nmeta_request (0.3.4) lib/meta_request/middlewares/meta_request_handler.rb:13:in `call'\r\nrack-affiliates (0.4.0) lib/rack-affiliates.rb:50:in `call'\r\nwarden (1.2.3) lib/warden/manager.rb:35:in `block in call'\r\nwarden (1.2.3) lib/warden/manager.rb:34:in `catch'\r\nwarden (1.2.3) lib/warden/manager.rb:34:in `call'\r\nrack (1.6.4) lib/rack/etag.rb:24:in `call'\r\nrack (1.6.4) lib/rack/conditionalget.rb:25:in `call'\r\nrack (1.6.4) lib/rack/head.rb:13:in `call'\r\nactionpack (4.2.3) lib/action_dispatch/middleware/params_parser.rb:27:in `call'\r\nactionpack (4.2.3) lib/action_dispatch/middleware/flash.rb:260:in `call'\r\nrack (1.6.4) lib/rack/session/abstract/id.rb:225:in `context'\r\nrack (1.6.4) lib/rack/session/abstract/id.rb:220:in `call'\r\nactionpack (4.2.3) lib/action_dispatch/middleware/cookies.rb:560:in `call'\r\nactiverecord (4.2.3) lib/active_record/query_cache.rb:36:in `call'\r\nactiverecord (4.2.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'\r\nactionpack (4.2.3) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'\r\nactivesupport (4.2.3) lib/active_support/callbacks.rb:84:in `run_callbacks'\r\nactionpack (4.2.3) lib/action_dispatch/middleware/callbacks.rb:27:in `call'\r\nactionpack (4.2.3) lib/action_dispatch/middleware/reloader.rb:73:in `call'\r\nactionpack (4.2.3) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'\r\nrack-contrib (1.3.0) lib/rack/contrib/response_headers.rb:17:in `call'\r\nmeta_request (0.3.4) lib/meta_request/middlewares/headers.rb:16:in `call'\r\nactionpack (4.2.3) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'\r\nactionpack (4.2.3) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'\r\nrailties (4.2.3) lib/rails/rack/logger.rb:38:in `call_app'\r\nrailties (4.2.3) lib/rails/rack/logger.rb:20:in `block in call'\r\nactivesupport (4.2.3) lib/active_support/tagged_logging.rb:68:in `block in tagged'\r\nactivesupport (4.2.3) lib/active_support/tagged_logging.rb:26:in `tagged'\r\nactivesupport (4.2.3) lib/active_support/tagged_logging.rb:68:in `tagged'\r\nrailties (4.2.3) lib/rails/rack/logger.rb:20:in `call'\r\nrequest_store (1.2.0) lib/request_store/middleware.rb:8:in `call'\r\nactionpack (4.2.3) lib/action_dispatch/middleware/request_id.rb:21:in `call'\r\nrack (1.6.4) lib/rack/methodoverride.rb:22:in `call'\r\nrack (1.6.4) lib/rack/runtime.rb:18:in `call'\r\nactivesupport (4.2.3) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'\r\nrack (1.6.4) lib/rack/lock.rb:17:in `call'\r\nactionpack (4.2.3) lib/action_dispatch/middleware/static.rb:116:in `call'\r\nfont_assets (0.1.11) lib/font_assets/middleware.rb:29:in `call'\r\nrack (1.6.4) lib/rack/sendfile.rb:113:in `call'\r\nrailties (4.2.3) lib/rails/engine.rb:518:in `call'\r\nrailties (4.2.3) lib/rails/application.rb:165:in `call'\r\nrailties (4.2.3) lib/rails/railtie.rb:194:in `public_send'\r\nrailties (4.2.3) lib/rails/railtie.rb:194:in `method_missing'\r\nrack (1.6.4) lib/rack/static.rb:124:in `call'\r\nrack (1.6.4) lib/rack/content_length.rb:15:in `call'\r\nthin (1.6.3) lib/thin/connection.rb:86:in `block in pre_process'\r\nthin (1.6.3) lib/thin/connection.rb:84:in `catch'\r\nthin (1.6.3) lib/thin/connection.rb:84:in `pre_process'\r\nthin (1.6.3) lib/thin/connection.rb:53:in `process'\r\nthin (1.6.3) lib/thin/connection.rb:39:in `receive_data'\r\neventmachine (1.0.7) lib/eventmachine.rb:187:in `run_machine'\r\neventmachine (1.0.7) lib/eventmachine.rb:187:in `run'\r\nthin (1.6.3) lib/thin/backends/base.rb:73:in `start'\r\nthin (1.6.3) lib/thin/server.rb:162:in `start'\r\nrack (1.6.4) lib/rack/handler/thin.rb:19:in `run'\r\nrack (1.6.4) lib/rack/server.rb:286:in `start'\r\nrailties (4.2.3) lib/rails/commands/server.rb:80:in `start'\r\nrailties (4.2.3) lib/rails/commands/commands_tasks.rb:80:in `block in server'\r\nrailties (4.2.3) lib/rails/commands/commands_tasks.rb:75:in `tap'\r\nrailties (4.2.3) lib/rails/commands/commands_tasks.rb:75:in `server'\r\nrailties (4.2.3) lib/rails/commands/commands_tasks.rb:39:in `run_command!'\r\nrailties (4.2.3) lib/rails/commands.rb:17:in `<top (required)>'\r\nscript/rails:6:in `require'\r\nscript/rails:6:in `<main>'"}}