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

Add docs for MysqlFramework::Scripts::Table #5

Open
chrisbarber86 opened this issue Jul 12, 2018 · 0 comments
Open

Add docs for MysqlFramework::Scripts::Table #5

chrisbarber86 opened this issue Jul 12, 2018 · 0 comments
Labels
good first issue Good for newcomers

Comments

@chrisbarber86
Copy link
Member

Need to add usage examples for MysqlFramework::Scripts::Table in README file.

e.g.

class UsersTable
  extend MysqlFramework::Scripts::Table

  NAME = 'users'

  COLUMNS = [
    :id,
    :name,
    :email,
    :created_at,
    :updated_at
  ]

  def self.column_names
    COLUMNS.map { |c| "`#{NAME}`.`#{c}`" }.join(',')
  end

  def self.values
    COLUMNS.map { |c| '?' }.join(',')
  end

  register_table NAME
end
@chrisbarber86 chrisbarber86 added the good first issue Good for newcomers label Jul 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Development

No branches or pull requests

1 participant