Skip to content

Commit 99cbaab

Browse files
committed
override objects with scope if exist
1 parent ff54bdc commit 99cbaab

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

lib/liquid-rails/drops/collection_drop.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def self.scope(*scope_names)
3131
def initialize(objects, options={})
3232
options.assert_valid_keys(:with, :scope)
3333

34-
@objects = objects
34+
@objects = options[:scope].nil? ? objects : objects.send(options[:scope])
3535
@drop_class_name = options[:with]
3636
end
3737

lib/liquid-rails/drops/drop.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ def self.dropify(resource, options={})
4545
else
4646
drop_class_for(resource)
4747
end
48+
4849
drop_class.new(resource, options.except(:class_name))
4950
end
5051

0 commit comments

Comments
 (0)