Skip to content

Allow custom params in function that use get_package_scope_var, default to said package_scope_var #161

@ChemiKyle

Description

@ChemiKyle

We should give users (and ourselves) the ability to override function variables that use get_package_scope_var, namely DB connection objects so that we can easily use in-memory databases while testing, rather than having to load a separate .env file for testing.

Updates would follow this template:

foo <- function(
...,
+db_conn = NULL
) {
- db_conn <- get_package_scope_var("db_conn")
+  if (is.null(db_conn)) {
+    db_conn <- get_package_scope_var("db_conn")
+  }
...
}

Relevant places that get_package_scope_var is called:

https://github.com/search?q=repo%3Actsit/rcc.billing%20get_package_scope_var&type=code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions