Module: CommonScopes

Extended by:
ActiveSupport::Concern
Included in:
AdoptionContact, Animal, AnimalColor, AnimalWeight, Document, Event, FosterContact, RelinquishmentContact, Shelter, Shot, Species, Status, User, VetContact, VolunteerContact
Defined in:
lib/common_scopes/common_scopes.rb

Class Method Summary collapse

Class Method Details

.included(klass) ⇒ Object


4
5
6
7
8
# File 'lib/common_scopes/common_scopes.rb', line 4

def self.included(klass)
  klass.instance_eval do
    scope :organization, lambda{ |user| where(organization_id: user.organization_id ) unless user.permissions.first.role_id == 1 }
  end
end