Release 0.5.1
This commit is contained in:
+20
-6
@@ -348,15 +348,29 @@ pub struct SelfTransition {
|
||||
/// with a case for as long as it runs, not only on the day they
|
||||
/// sent it: an applicant written to for a missing drawing answers
|
||||
/// from `incomplete`, and may withdraw from anywhere along the
|
||||
/// way. Defaults to the initial state alone, which is what every
|
||||
/// one-shot "unsubscribe" link wants and what this was before it
|
||||
/// could be said.
|
||||
#[serde(default = "initial_state_only")]
|
||||
/// way.
|
||||
///
|
||||
/// Empty means the bucket's own initial state, which is the
|
||||
/// one-shot "confirm" or "unsubscribe" link every one of these was
|
||||
/// before it could say otherwise. Its own initial state, not the
|
||||
/// word `open`: a bucket whose records start at `pending` has a
|
||||
/// confirmation link that fires from `pending`, and reading the
|
||||
/// literal here is what made redoal's watch-confirm button a rule
|
||||
/// the engine would never match.
|
||||
#[serde(default)]
|
||||
pub from: Vec<String>,
|
||||
}
|
||||
|
||||
fn initial_state_only() -> Vec<String> {
|
||||
vec![crate::answers::OPEN_STATE.to_string()]
|
||||
impl SelfTransition {
|
||||
/// The states this move may be made from, with the bucket's
|
||||
/// initial state standing in when the content named none.
|
||||
pub fn from_states(&self, initial: &str) -> Vec<String> {
|
||||
if self.from.is_empty() {
|
||||
vec![initial.to_string()]
|
||||
} else {
|
||||
self.from.clone()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
|
||||
Reference in New Issue
Block a user