$> 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
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> |
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)reserved
// Before
{
"status": true,
"length": 1,
"data": {
"id": "16",
"type": "Moodle::Competency",
"attributes": {
"shortname": "Comp 3",Tulisan ini mencoba untuk membahas cara pembuatan fitur keranjang belanja pada sebuah aplikasi E-commerce.
Keranjang belanja dikenal sifatnya yang dinamis dan mungkin tidak cocok untuk disimpan di database. Walapun jika anda memiliki orang data science, mungkin saja lebih baik anda menyimpannya di database.
Namun tulisan ini hanya akan memperlihatkan pengimplementasian pada sessions saja.
Session sebenarnya adalah cookies yang dienkripsi. Cookies dikenal dengan sturktur data key-dan-values : key = value. Jika anda ingin menyimpan nilai array anda mungkin akan menemukan masalah.