-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Darn, that's embarrassing. Here's the file.
On 12/7/2010 01:23, Sam Whited wrote: > > On 12/6/2010 22:35, Jim Gay wrote: >>> A well-tested patch would be applied, for sure. Or, if you can't do >>> that, make an issue for it https://github.com/radiant/radiant/issues > > How about something like this? > It appears to be working for me and is not causing any problems (it > shouldn't, it's a grand total of 3 lines of code). It simply adds the > 'defaults.snippet.filter' option which works exactly the same as > 'defaults.page.filter'. > > I'll forward this over to radiant-dev once I get a bit of feedback (I've > never submitted a patch for Radiant before, so I'd like to read up on > all policies and procedures first and make sure I do the thing properly, > even for a patch as simple as this one). > > Best, > Sam > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJM/dMlAAoJEHjfG+UNu1Ff9lsIAK7SK9u49fV5U58Qlf4ldFtr 1UPs/u8QO/4mNdfzZHftZRDhlg5G62v58asJpSJIPtV8ZcSpyNunxS12jKZwNyXy ml8FK7UDDpCKvCK0p1KY0Ip6ztDEzAS/cMJhuTV+ny+5V9mwiWZtLjp/mY82I8pw Qh0g5d25CHc5oGWt69MlOwwUUJadllbl4MDp5sNs2F4BcDx6ZyeAnvjUrnaLdfk0 x9x7brAr7APuFCRiaKxxqgYasUO5pJt847uO+2RGrjaU6YUrIdqFg/D4ZsINipaB ef6s0Gh6nYf5QU9tR/UQrFiN1nYp/L4jPGkA7fVUBcuHCnioqCePPcZeOcsPjH8= =iB5o -----END PGP SIGNATURE-----
>From 1e5f8099926200467cfbf26c9f636ce214102bd5 Mon Sep 17 00:00:00 2001 From: Samuel Whited <s...@samwhited.com> Date: Tue, 7 Dec 2010 01:10:30 -0500 Subject: [PATCH] Added a config option 'defaults.snippet.filter' to set the default filter for snippets --- app/models/snippet.rb | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/app/models/snippet.rb b/app/models/snippet.rb index 4c8d196..2f1df43 100644 --- a/app/models/snippet.rb +++ b/app/models/snippet.rb @@ -16,4 +16,8 @@ class Snippet < ActiveRecord::Base object_id_attr :filter, TextFilter + def after_initialize + self.filter_id ||= Radiant::Config['defaults.snippet.filter'] if new_record? + end + end -- 126.96.36.199
Description: Binary data