Class: Trestle::Resource::Collection
- Inherits:
-
Object
- Object
- Trestle::Resource::Collection
- Defined in:
- lib/trestle/resource/collection.rb
Instance Method Summary collapse
-
#initialize(admin) ⇒ Collection
constructor
A new instance of Collection.
- #prepare(params) ⇒ Object
Constructor Details
#initialize(admin) ⇒ Collection
Returns a new instance of Collection.
7 8 9 |
# File 'lib/trestle/resource/collection.rb', line 7 def initialize(admin) @admin = admin end |
Instance Method Details
#prepare(params) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/trestle/resource/collection.rb', line 11 def prepare(params) collection = initialize_collection(params) collection = apply_scopes(collection, params) collection = apply_sorting(collection, params) collection = paginate(collection, params) collection = finalize_collection(collection) collection = decorate_collection(collection) collection end |