Module: UtilityScopes::Pks::ClassMethods

Defined in:
lib/utility_scopes/pks.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) only_pks

Can't use named_scope b/c don't have access to table_name etc... yet



14
15
16
# File 'lib/utility_scopes/pks.rb', line 14

def only_pks
  scoped(:select => "`#{table_name}`.#{primary_key}")
end

- (Object) pks



18
19
20
# File 'lib/utility_scopes/pks.rb', line 18

def pks
  only_pks.collect(&:#{primary_key}")
end