reserved
courses = Moodle::Course.taken_by(current_user)
// Completed 200 OK in 161ms (Views: 0.2ms | ActiveRecord: 37.6ms
// Completed 200 OK in 102ms (Views: 0.2ms | ActiveRecord: 31.1ms)
``
``rb
courses = Moodle::Course.includes(user_enrollments: [{ enrollments: [:courses] }]).taken_by(current_user)
// Completed 200 OK in 148ms (Views: 0.2ms | ActiveRecord: 37.4ms)
// Completed 200 OK in 109ms (Views: 0.1ms | ActiveRecord: 34.8ms)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
<title>Add Remove Dynamic HTML Fields using JQuery Plugin in PHP</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" /> | |
<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ" crossorigin="anonymous"></script> |
$> time rspec
Finished in 6 minutes 54 seconds (files took 13.31 seconds to load)
823 examples, 0 failures
Coverage report generated for RSpec to /home/harukaedu/Codes/ruby/cms-corp-u/coverage. 2908 / 3003 LOC (96.84%) covered.
bundle exec rspec 151,89s user 21,29s system 39% cpu 7:14,58 total
pipeline {
agent any
stages {
stage('Preparation') {
steps {
git branch: '**',
credentialsId: '95ba7d88-78e8-429d-8d3a-bb51a6800c37',
url: '[email protected]:harukaedudev/ahmeng.git'
}
# Presenter
user = User.find_by(id: params[:id]) # <first_name='Nobu'; last_name='Boki'>
@user = UserPresenter.new(user)
@user.name # 'Nobu Boki'
# When use in collections
users = UserPresenter.to_collection(User.all)
users.first.class.name # UserPresenter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"editor.fontFamily": "Jetbrains Mono, Dank Mono, Menlo, Monaco, 'Courier New', monospace", | |
"workbench.colorTheme": "Dracula", | |
"workbench.iconTheme": "Monokai Pro Icons", | |
"window.zoomLevel": -1, | |
"editor.tabSize": 2, | |
"ruby.useLanguageServer": true, | |
"ruby.lint": { | |
"ruby": true | |
}, |
Before:
$> brakeman --only-files app/models/plugin_mokapos_setting.rb
Loading scanner...
Processing application in /Users/philiplambok/Codes/ruby/quickbook
Processing gems...
[Notice] Detected Rails 4 application
Processing configuration...
[Notice] Escaping HTML by default
Parsing files...