Skip to content

Conversation

ccallebs
Copy link
Contributor

From #427 -- This simply allows selecting the current users variation/alternative on the dashboard. Helpful for when you're debugging a single alternative and don't want to keep overriding the URL parameter.

Example:

screen shot 2016-09-27 at 9 54 09 pm

Note: Not happy with the copy, but it's late and I couldn't think of anything else. :)

@coveralls
Copy link

coveralls commented Sep 28, 2016

Coverage Status

Coverage decreased (-0.1%) to 98.978% when pulling 77a984a on ccallebs:add-force-alternative into 95cff59 on splitrb:master.

@andrew
Copy link
Member

andrew commented Oct 5, 2016

Looks handy, just need to fix the failing test and I'll get it merged, thanks!

@dmur
Copy link

dmur commented Nov 2, 2016

👍

@ccallebs ccallebs force-pushed the add-force-alternative branch from c449a69 to 7f908d3 Compare November 10, 2016 21:46
@ccallebs
Copy link
Contributor Author

ccallebs commented Nov 10, 2016

@andrew Spec fixed, branch rebased into single commit! Sorry for the delay.

@andrew andrew merged commit 7170899 into splitrb:master Nov 11, 2016
@andrew
Copy link
Member

andrew commented Nov 11, 2016

@ccallebs thanks, merged! 🎉

@ccallebs ccallebs deleted the add-force-alternative branch November 11, 2016 19:15
@teguhn
Copy link

teguhn commented Dec 8, 2016

Does this mean we can't use the URL parameter anymore?

@ccallebs
Copy link
Contributor Author

ccallebs commented Dec 8, 2016

@teguhn The URL parameters should still overwrite whatever value the user has set. This just allows you to overwrite globally, so you don't have to keep adding the URL parameter when testing.

@gibacache
Copy link

gibacache commented Sep 29, 2017

@ccallebs I get undefined method 'current_user' for #<Split::Dashboard:0x00557c18105470> when trying to force for current_user.
I have the RedisAdapter for persistance:
config.persistence = Split::Persistence::RedisAdapter.with_config(lookup_by: -> (context) { context.send(:current_user).try(:id) })
How can I have the current_user method available in the Dashboard? Am I doing something wrong?
Thanks!

@ccallebs
Copy link
Contributor Author

@gibacache I'm unfamiliar with that syntax, but you might try evaluating what methods are available from context. For example, if you can access cookies/session you could derive the current_user.

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

Successfully merging this pull request may close these issues.

6 participants