I have a question about `ActiveRecord.locking_column`.

9 views
Skip to first unread message

UG Muscle

unread,
Jun 10, 2018, 10:43:21 AM6/10/18
to Ruby on Rails: Talk

Suppose the User model defines a column like this and does not have lock_version
```
class DeviseCreateUsers < ActiveRecord::Migration[5.1]
   def change
     create_table :users do |t|
       t.string :name
       # do not have a lock_version and other optimistic locks
     end
   end
end
```
When executing User.locking_column, I thought that I would return nil because This Model does not have locking_column, but return "locking_column".
Would you like to submit a PR that returns nil if there is no problem?

Thanks to read🙏
Reply all
Reply to author
Forward
0 new messages