lib/og/store/kirby.rb in og-0.25.0 vs lib/og/store/kirby.rb in og-0.26.0

- old
+ new

@@ -1,9 +1,9 @@ begin - require 'og/vendor/kirbybase' + require 'kirbybase' rescue Object => ex - Logger.error 'KirbyBase is not installed!' + Logger.error "KirbyBase is not installed. Please run 'gem install KirbyBase'" Logger.error ex end require 'fileutils' @@ -56,13 +56,13 @@ # Nothing to do. super end def enchant(klass, manager) - klass.send :attr_accessor, :recno - klass.send :alias_method, :oid, :recno - klass.send :alias_method, :oid=, :recno= + klass.send :attr_accessor, :oid + klass.send :alias_method, :recno, :oid + klass.send :alias_method, :recno=, :oid= symbols = klass.properties.keys klass.module_eval %{ def self.kb_create(recno, #{symbols.join(', ')}) @@ -126,9 +126,10 @@ else objects = table.select end if order = options[:order] + order = order.to_s desc = (order =~ /DESC/) order = order.gsub(/DESC/, '').gsub(/ASC/, '') eval "objects.sort { |x, y| x.#{order} <=> y.#{order} }" objects.reverse! if desc end