{"comment":{"created_at":"2011-10-13T21:36:25Z","body":"Sorry, I don't know what do you mean with double pipe. I try to change \r\n\r\n```ruby\r\n@databases   = self.databases   | model.databases\r\n``` \r\n\r\nby \r\n\r\n```ruby\r\n@databases   = self.databases   || model.databases\r\n````\r\n\r\nIt does not work, but again, I'm a newbie in Ruby :p\r\n\r\nI also try to make a clone of the parent and also to call store_with. I try something like that:\r\n\r\n``` ruby\r\n\r\nbase = Backup::Model.new(:db_backup, 'My Backup', '') do\r\n   ....\r\nend\r\n\r\nweekly = base.clone\r\nweekly.trigger = :weekly\r\nweekly.store_with S3 do |s3|\r\n    s3.access_key_id      = 'my_access_key_id'\r\n    s3.secret_access_key  = 'my_secret_access_key'\r\n    s3.region             = 'us-east-1'\r\n    s3.bucket             = 'bucket-name'\r\n    s3.path               = '/path/to/my/backups'\r\n    s3.keep               = 10\r\nend\r\nBackup::Model.all << weekly\r\n```\r\n\r\nAnd it works. I think it's a bit tricky because it needs to take a look at the backup's code but it's ok for my purpose.\r\n\r\nThanks :)","updated_at":"2011-10-13T21:36:25Z","url":"https://api.github.com/repos/meskyanichi/backup/issues/comments/2400527","id":2400527,"user":{"gravatar_id":"c41e721b2e1a3243004aab5fabf8032a","avatar_url":"https://secure.gravatar.com/avatar/c41e721b2e1a3243004aab5fabf8032a?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/cbou","id":611389,"login":"cbou"}},"action":"created","issue":{"number":191,"created_at":"2011-10-09T13:04:00Z","pull_request":{"diff_url":"https://github.com/meskyanichi/backup/pull/191.diff","patch_url":"https://github.com/meskyanichi/backup/pull/191.patch","html_url":"https://github.com/meskyanichi/backup/pull/191"},"body":"Hi,\r\n\r\nI tried to write a way to have extendable model. I wanted to do such a config possible:\r\n\r\n```ruby\r\nBackup::Model.new(:db_backup, 'My Backup', '') do\r\n\r\n  database MySQL do |db|\r\n    db.name               = \"firstdb\"\r\n    db.username           = \"firstdb\"\r\n    db.password           = \"firstdb\"\r\n    db.host               = \"localhost\"\r\n    db.port               = 3306\r\n    db.socket             = \"/var/run/mysqld/mysqld.sock\"\r\n  end\r\n\r\n  database MySQL do |db|\r\n    db.name               = \"seconddb\"\r\n    db.username           = \"seconddb\"\r\n    db.password           = \"seconddb\"\r\n    db.host               = \"localhost\"\r\n    db.port               = 3306\r\n    db.socket             = \"/var/run/mysqld/mysqld.sock\"\r\n  end\r\n\r\n  compress_with Gzip do |compression|\r\n    compression.best = true\r\n    compression.fast = false\r\n  end\r\n\r\nend\r\n\r\nBackup::Model.new(:daily, 'My Backup', :db_backup) do\r\n\r\n  store_with S3 do |s3|\r\n    s3.access_key_id      = 'my_access_key_id'\r\n    s3.secret_access_key  = 'my_secret_access_key'\r\n    s3.region             = 'us-east-1'\r\n    s3.bucket             = 'bucket-name'\r\n    s3.path               = '/path/to/my/daily-backups'\r\n    s3.keep               = 10\r\n  end\r\n\r\nend\r\n\r\nBackup::Model.new(:weekly, 'My Backup', :db_backup) do\r\n\r\n  store_with S3 do |s3|\r\n    s3.access_key_id      = 'my_access_key_id'\r\n    s3.secret_access_key  = 'my_secret_access_key'\r\n    s3.region             = 'us-east-1'\r\n    s3.bucket             = 'bucket-name'\r\n    s3.path               = '/path/to/my/weekly-backups'\r\n    s3.keep               = 10\r\n  end\r\n\r\nend\r\n\r\nBackup::Model.new(:monthly, 'My Backup', :db_backup) do\r\n\r\n  store_with S3 do |s3|\r\n    s3.access_key_id      = 'my_access_key_id'\r\n    s3.secret_access_key  = 'my_secret_access_key'\r\n    s3.region             = 'us-east-1'\r\n    s3.bucket             = 'bucket-name'\r\n    s3.path               = '/path/to/my/monthly-backups'\r\n    s3.keep               = 10\r\n  end\r\n\r\nend\r\n\r\n```\r\n\r\nI'm very new in ruby, so feel free to make a better implementation if you want to keep this feature.","comments":2,"title":"make model extendable","updated_at":"2011-10-13T21:36:25Z","url":"https://api.github.com/repos/meskyanichi/backup/issues/191","id":1855979,"assignee":null,"milestone":null,"closed_at":null,"user":{"gravatar_id":"c41e721b2e1a3243004aab5fabf8032a","avatar_url":"https://secure.gravatar.com/avatar/c41e721b2e1a3243004aab5fabf8032a?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/cbou","id":611389,"login":"cbou"},"html_url":"https://github.com/meskyanichi/backup/issues/191","labels":[],"state":"open"},"legacy":{"issue_id":1855979,"comment_id":2400527}}