On Tuesday, February 18, 2020 at 6:59:15 PM UTC+1, Momeas Interactive wrote:
>
> I don't think polymorphism in Rails can work that way
>
> did you try
>
>
> `has_many :users_following, through: :active_relationships, source:
> :followable, source_type: "FollowableUser"`
>
> `has_many
I am trying to setup a way for my `User` and `Project` model to both be
followed through the same `Relationship` model.
I also want to be able to get all items the user has followed with this
association:
`has_many :following, through: :active_relationships, source: :followable,
source_type:
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
```
I doubt that the model that inherited ActiveRecord will return lock_version
even if it does not have locking_column (lock_version etc.).
Please let me know if anyone knows why such an implementation is in place.
If there is no reason I will make a PR to fix
--
You received this message because
4 matches
Mail list logo