Permalink
Browse files

Use ARel and by default order by created_at DESC.

  • Loading branch information...
1 parent 9934011 commit fa4588395393de1fd90043845bc0b7c51efede69 @parndt parndt committed Oct 12, 2010
Showing with 5 additions and 5 deletions.
  1. +3 −3 app/models/inquiry.rb
  2. +1 −1 lib/gemspec.rb
  3. +1 −1 refinerycms-inquiries.gemspec
View
@@ -12,13 +12,13 @@ class Inquiry < ActiveRecord::Base
acts_as_indexed :fields => [:name, :email, :message, :phone]
- scope :newest, :order => 'created_at DESC'
+ default_scope :order => 'created_at DESC' # previously scope :newest
def self.latest(number = 7, include_spam = false)
unless include_spam
- ham.find(:all, :limit => number)
+ ham.limit(number)
else
- newest.find(:all, :limit => number)
+ limit(number)
end
end
View
@@ -1,5 +1,5 @@
#!/usr/bin/env ruby
-version = '0.9.9'
+version = '0.9.9.1'
raise "Could not get version so gemspec can not be built" if version.nil?
files = Dir.glob("**/*").flatten.reject do |file|
file =~ /\.gem$/
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = %q{refinerycms-inquiries}
- s.version = %q{0.9.9}
+ s.version = %q{0.9.9.1}
s.date = %q{2010-10-13}
s.summary = %q{Inquiry handling functionality for the Refinery CMS project.}
s.description = %q{Inquiry handling functionality extracted from Refinery CMS to allow you to have a contact form and manage inquiries in the Refinery backend.}

0 comments on commit fa45883

Please sign in to comment.