Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collections should delegate to their Model like rails does #400

Closed
catmando opened this issue Apr 1, 2021 · 1 comment
Closed

Collections should delegate to their Model like rails does #400

catmando opened this issue Apr 1, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@catmando
Copy link
Contributor

catmando commented Apr 1, 2021

class Word < ApplicationRecord 
  def self.by_size(size)
    where("LENGTH(text) = ?", size)
  end
end

I should be able to say:

Word.where(swear_word: true).by_size(4)

Rails lets you do this. It is more useful now that where is implemented

This will also allow some cleanup in the Collections class

@catmando catmando added the enhancement New feature or request label Apr 1, 2021
@catmando
Copy link
Contributor Author

catmando commented Apr 5, 2021

closed in 1.0.alpha1.7

@catmando catmando closed this as completed Apr 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant