Coder Social home page Coder Social logo

detour's People

Contributors

jclem avatar

Stargazers

 avatar

Watchers

 avatar  avatar

detour's Issues

All those redundant types...

These all seem redundant:

  t.string  :group_type
  t.string  :percentage_type
  t.string  :flag_subject_type

I know it's nice to use the polymorphic keyword, but isn't there a better way? Only one of these would exist at a time.

Don't require user to click "Add Member"

For both group management and flag-ins/opt-outs, the user should not have to click an "Add" button. Rather, if all fields have a value, add another one automatically.

Reliable feature check detection

Currently, ActiveRecord::Rollout::Feature.all-with_lines can only detect feature checks of these forms:

foo.has_feature? :foo
foo.has_feature?(:foo)

Meaning that forms such as these will not register (with our without parentheses):

foo.has_feature? "foo"
foo.has_feature? "Feature Name"

Not sure if this is a bug, or if it should just validate that feature names be composed of alphanumeric characters and underscores. It's easy enough to at least update the regex to also find:

foo.has_feature? "foo_bar"

Support default flaggable

In an initializer:

ActiveRecord::Rollout.configure do |config|
  config.default_flaggable_type = "User"
end

Then, in a rake task (paired with #10):

$ rake rollout:activate[foo,[email protected]]
$ rake rollout:activate_group[foo,admins]

This could also be assumed if only a single class implements acts_as_flaggable.

Support checking rollout across multiple flaggables

Allow support for:

ActiveRecord::Rollout.any_have_feature?(current_user, current_user.organization)

and

ActiveRecord::Rollout.all_have_feature?(current_user, current_user.organization)

Update:

What's probably more valuable is a check that returns true if any of the arguments have the feature and none of them are opted out.

Implement `acts_as_flaggable`

Before:

class User < ActiveRecord::Base
  include ActiveRecord::Rollout::Flaggable
end

After:

class User < ActiveRecord::Base
  acts_as_flaggable
end

Validate DB indices

There are currently minimal database indices defined in the migration. Need to take a second look at these and make sure we're not querying anything frequently that's not indexed.

Memoize features on flaggables

For the same instance of Flaggable, calling has_feature?(:foo) multiple times should only actually check for :foo once. They should be memoized in an @active_record_rollout_features instance variable.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.