From 9d127ccd68498989756a72bb88333b5b8f2c0a9d Mon Sep 17 00:00:00 2001 From: Jeroen Jacobs Date: Thu, 7 May 2015 12:09:33 +0200 Subject: [PATCH] Allows model name to be a String or a Symbol --- README.md | 2 +- resources/model.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 033d99c..b66efc8 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ Creates a backup model with an optional `cron` schedule. ### Attribute Parameters -* The name attribute - A symbol used as the trigger name. +* The name attribute - A string or symbol used as the trigger name. * `description` - A description for the backup. Default is the same as the name. * `definition` - A string (best formed as a heredoc) defining the backup. Will be interpoleted and turned into a model file. Required. * `schedule` - A hash of times (minute, hour, day, month, weekday) that will be passed to a [`cron` resource](http://docs.opscode.com/chef/resources.html#cron). diff --git a/resources/model.rb b/resources/model.rb index c1f552c..3dd631d 100644 --- a/resources/model.rb +++ b/resources/model.rb @@ -1,7 +1,7 @@ actions :create, :delete default_action :create -attribute :name, :kind_of => Symbol, :name_attribute => true, :required => true +attribute :name, :kind_of => [String, Symbol], :name_attribute => true, :required => true attribute :description, :kind_of => String attribute :definition, :kind_of => String