]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/user.rb
Force all OpenLayers resources to load through the asset pipeline
[rails.git] / app / models / user.rb
index 759c8d0b04f81b24690b28719c153af96963eff3..d3a05d4bb7bedd39134f97d04033d0558916a1f0 100644 (file)
@@ -18,6 +18,9 @@ class User < ActiveRecord::Base
   has_many :active_blocks, :class_name => "UserBlock", :conditions => proc { [ "user_blocks.ends_at > :ends_at or user_blocks.needs_view", { :ends_at => Time.now.getutc } ] }
   has_many :roles, :class_name => "UserRole"
 
+  scope :visible, where(:status => ["pending", "active", "confirmed"])
+  scope :active, where(:status => ["active", "confirmed"])
+
   validates_presence_of :email, :display_name
   validates_confirmation_of :email#, :message => ' addresses must match'
   validates_confirmation_of :pass_crypt#, :message => ' must match the confirmation password'