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

Base Model #23

Open
nicolas-brousse opened this issue Apr 11, 2013 · 0 comments
Open

Base Model #23

nicolas-brousse opened this issue Apr 11, 2013 · 0 comments
Assignees
Milestone

Comments

@nicolas-brousse
Copy link
Contributor

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.

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

No branches or pull requests

1 participant