Class: Gallerist::Person
- Inherits:
-
PersonModel
- Object
- ActiveRecord::Base
- BaseModel
- PersonModel
- Gallerist::Person
- Defined in:
- lib/gallerist/models/person.rb
Overview
This code is free software; you can redistribute it and/or modify it under the terms of the new BSD License.
Copyright © 2015, Sebastian Staudt
Instance Method Summary collapse
- #inspect ⇒ Object
-
#photos ⇒ Object
ActiveRecord does not support has_many-through associations across different databases, so we have to query the photos manually.
- #to_s ⇒ Object
Methods inherited from BaseModel
iphoto, photos, setup_for, store_setup
Instance Method Details
#inspect ⇒ Object
32 33 34 |
# File 'lib/gallerist/models/person.rb', line 32 def inspect "#<%s id=%d name='%s'>" % [ self.class, id, name ] end |
#photos ⇒ Object
ActiveRecord does not support has_many-through associations across different databases, so we have to query the photos manually
38 39 40 |
# File 'lib/gallerist/models/person.rb', line 38 def photos Gallerist::Photo.where modelId: person_photos.map(&:photo_id) end |
#to_s ⇒ Object
42 43 44 |
# File 'lib/gallerist/models/person.rb', line 42 def to_s name end |