Skip to content

Base Model #23

@nicolas-brousse

Description

@nicolas-brousse

Create a Base Model or something like that whit this type of content.

include a ruby module or overload ActiveRecord::Base ?

module
  class << self
    def total_count
      offset(nil).limit(nil).count
    end

    def search(query, opts*)
      # TODO: search function to use specifics methods with PgSQL and accents
      # Or continue to use meta_search
      # Or found other solution
    end
  end
end

Do a module to automatically add before_create with uuid generation?
See how run friendly_id for inspiration.

One idea is to have a directory into lib/ like lib/model/ with PaginationExtension, SearchExtension and UUIDGenerationExtension for example.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions