Skip to content

Collections should delegate to their Model like rails does #400

Closed
@catmando

Description

@catmando
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions