Module: UtilityScopes::Pks::ClassMethods
- Defined in:
- lib/utility_scopes/pks.rb
Instance Method Summary collapse
-
#only_pks ⇒ Object
Can’t use named_scope b/c don’t have access to table_name etc…
- #pks ⇒ Object
Instance Method Details
#only_pks ⇒ Object
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 |
#pks ⇒ Object
18 19 20 |
# File 'lib/utility_scopes/pks.rb', line 18 def pks only_pks.collect(&:"#{primary_key}") end |