Skip to content

Where satisfies: constrained arel, block with method, use where chain - #6

Open
brunvez wants to merge 1 commit into
mainfrom
where_satisfies
Open

Where satisfies: constrained arel, block with method, use where chain#6
brunvez wants to merge 1 commit into
mainfrom
where_satisfies

Conversation

@brunvez

@brunvez brunvez commented Apr 16, 2021

Copy link
Copy Markdown
Owner

Summary

Other Information

end

def test_where_satisfies
relation = Post.where.satisfies { |post| (post.author_id != 1).and(post.id > 2) }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like the wharel method, the satisfies after the where seems confusing (at least to me). Do Rails provide another API similar to this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants