From 691617befa395635853d5ef9605a4039c07922a5 Mon Sep 17 00:00:00 2001 From: Leandro Nunes dos Santos Date: Sun, 18 May 2014 15:56:08 -0300 Subject: [PATCH] adding newer_than and older_then named scopes --- app/models/profile.rb | 10 ++++++++++ 1 file changed, 10 insertions(+), 0 deletions(-) diff --git a/app/models/profile.rb b/app/models/profile.rb index d4637ea..c6805c2 100644 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -99,6 +99,16 @@ class Profile < ActiveRecord::Base } scope :no_templates, {:conditions => {:is_template => false}} + #FIXME make this test + named_scope :newer_than, lambda { |reference_id| + {:conditions => ["profiles.id > #{reference_id}"]} + } + + #FIXME make this test + named_scope :older_than, lambda { |reference_id| + {:conditions => ["profiles.id < #{reference_id}"]} + } + def members scopes = plugins.dispatch_scopes(:organization_members, self) scopes << Person.members_of(self) -- libgit2 0.21.2