instance method
test_persisted?
Ruby on Rails 4.2.9
Since v3.0.20Signature
test_persisted?()
Responds to persisted?
Returns a boolean that specifies whether the object has been persisted yet. This is used when calculating the URL for an object. If the object is not persisted, a form for that object, for instance, will route to the create action. If it is persisted, a form for the object will routes to the update action.
Source
# File activemodel/lib/active_model/lint.rb, line 69
def test_persisted?
assert model.respond_to?(:persisted?), "The model should respond to persisted?"
assert_boolean model.persisted?, "persisted?"
end
Defined in activemodel/lib/active_model/lint.rb line 69
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveModel::Lint::Tests