diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 797c494..63efec8 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -90,7 +90,10 @@ module ApplicationHelper end end + # Print the attributes from the list def cascade model, list + return "" if model.nil? + out = list.map do |element| name = key = element item = "" @@ -104,10 +107,15 @@ module ApplicationHelper if m = key.to_s.match(/^(.*)_b$/) name = m[1] key = m[1] + end + + begin + str = eval("model.#{key}") + rescue + next end - str = eval("model.#{key}") - next if str == "" or str.nil? + next if str == "" or str.nil? if model[key].instance_of?(Time) or model[key].instance_of?(ActiveSupport::TimeWithZone) # result << shorttime(str) diff --git a/app/models/article.rb b/app/models/article.rb index 86acef0..0eadf49 100644 --- a/app/models/article.rb +++ b/app/models/article.rb @@ -89,11 +89,11 @@ class Article < ActiveRecord::Base end def previous_article - category.articles.nodrafts.first&.(where("id < ?", self.id).order("id DESC")) + category.articles.nodrafts.where("id < ?", self.id).order("id DESC").first end def next_article - category.articles.nodrafts.first&.(where("id > ?", self.id).order("id ASC")) + category.articles.nodrafts.where("id > ?", self.id).order("id ASC").first end def statuses diff --git a/app/models/directory.rb b/app/models/directory.rb index a4b351a..3219a6a 100644 --- a/app/models/directory.rb +++ b/app/models/directory.rb @@ -58,7 +58,7 @@ class Directory < ActiveRecord::Base validates_with PathValidator # TODO: add validation for path - before_validation :init_variables, on: :create + before_validation :init_variables after_create :make_path after_save :update_timestamp before_destroy :remove_files, unless: Proc.new { preserve_files } diff --git a/app/views/about/staff.html.erb b/app/views/about/staff.html.erb index fae68f3..683de57 100644 --- a/app/views/about/staff.html.erb +++ b/app/views/about/staff.html.erb @@ -1,6 +1,6 @@
- We are a free-working organization founded in 2005 which has organized various competitions for the Half-Life mod Natural Selection. + We are a non-profit organization founded in 2005 which has organized various competitions for the Half-Life mod Natural Selection. We now primarily focus on its successor, Natural Selection 2.
To contact us:
@@ -8,7 +8,7 @@