Skip to content

Commit

Permalink
Merge pull request #594 from samvera-labs/change_set_optimistic_locki…
Browse files Browse the repository at this point in the history
…ng_enabled

Delegate optimistic_locking_enabled? for ChangeSet
  • Loading branch information
awead authored Aug 29, 2018
2 parents 276c22d + 3955a74 commit 1beedc6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/valkyrie/change_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def [](key)

delegate :attributes, to: :resource

delegate :internal_resource, :created_at, :updated_at, :model_name, to: :resource
delegate :internal_resource, :created_at, :updated_at, :model_name, :optimistic_locking_enabled?, to: :resource

# Prepopulates all fields with defaults defined in the changeset. This is an
# override of Reform::Form's method to allow for single-valued fields to
Expand Down
6 changes: 6 additions & 0 deletions lib/valkyrie/specs/shared_specs/change_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,10 @@
expect(described_class).to respond_to(:validators_on)
end
end

describe "#optimistic_locking_enabled?" do
it "delegates down to the resource" do
expect(change_set.optimistic_locking_enabled?).to eq false
end
end
end

0 comments on commit 1beedc6

Please sign in to comment.