Mercurial > hg > soundsoftware-site
diff .svn/pristine/48/48b2840db60b271c593d21c38917c44a5158b68b.svn-base @ 909:cbb26bc654de redmine-1.3
Update to Redmine 1.3-stable branch (Redmine SVN rev 8964)
author | Chris Cannam |
---|---|
date | Fri, 24 Feb 2012 19:09:32 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.svn/pristine/48/48b2840db60b271c593d21c38917c44a5158b68b.svn-base Fri Feb 24 19:09:32 2012 +0000 @@ -0,0 +1,29 @@ +# Rails <2.x doesn't define #except +class Hash #:nodoc: + # Returns a new hash without the given keys. + def except(*keys) + clone.except!(*keys) + end unless method_defined?(:except) + + # Replaces the hash without the given keys. + def except!(*keys) + keys.map! { |key| convert_key(key) } if respond_to?(:convert_key) + keys.each { |key| delete(key) } + self + end unless method_defined?(:except!) +end + +# NamedScope is new to Rails 2.1 +unless defined? ActiveRecord::NamedScope + require 'awesome_nested_set/named_scope' + ActiveRecord::Base.class_eval do + include CollectiveIdea::NamedScope + end +end + +# Rails 1.2.x doesn't define #quoted_table_name +class ActiveRecord::Base #:nodoc: + def self.quoted_table_name + self.connection.quote_column_name(self.table_name) + end unless methods.include?('quoted_table_name') +end \ No newline at end of file