Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions lib/mongoid/extensions/set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@ def mongoize(object)
when ::Array then ::Array.mongoize(object).uniq
end
end

# Returns whether the object's size can be changed.
#
# @example Is the object resizable?
# Set.resizable?
#
# @return [ true ] true.
def resizable?
true
end
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/mongoid/extensions/array_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@
end
end

describe "#resiable?" do
describe "#resizable?" do

it "returns true" do
expect([]).to be_resizable
Expand Down
14 changes: 14 additions & 0 deletions spec/mongoid/extensions/set_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,18 @@
end
end
end

describe ".resizable?" do

it "returns true" do
expect(Set).to be_resizable
end
end

describe "#resizable?" do

it "returns true" do
expect(Set.new).to be_resizable
end
end
end
Loading