diff options
Diffstat (limited to 'lib/Update.rb')
| -rw-r--r-- | lib/Update.rb | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/lib/Update.rb b/lib/Update.rb deleted file mode 100644 index 480bb0b..0000000 --- a/lib/Update.rb +++ /dev/null | |||
| @@ -1,17 +0,0 @@ | |||
| 1 | module Update | ||
| 2 | |||
| 3 | def self.find_or_create_parent | ||
| 4 | current_year = Time.now.year.to_s | ||
| 5 | |||
| 6 | if parent = Node.find_by_unique_name("updates/#{current_year}") | ||
| 7 | parent | ||
| 8 | else | ||
| 9 | unless updates = Node.find_by_unique_name("updates") | ||
| 10 | updates = Node.root.children.create(:slug => "updates") | ||
| 11 | end | ||
| 12 | parent = updates.children.create(:slug => current_year) | ||
| 13 | parent | ||
| 14 | end | ||
| 15 | end | ||
| 16 | |||
| 17 | end \ No newline at end of file | ||
