This file contains 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
``` | |
SQL_STRING = <<~"SQL_STRING" | |
SELECT COUNT(*) as total_aritcle, users.name | |
FROM | |
INNER JOIN articles ON users.id = articles.user_id | |
GROUP BY | |
users.id | |
SQL_STRING | |
``` | |
`ActiveRecord::Base.connection.exec_query SQL_STRING` |
This file contains 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
check_box_tag 'auth_id[]', store.first, false, id: "store_#{store.first}", disabled: @setting.store_managed |
This file contains 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
scope :abc, ->(company_id) { | |
A.joins(b: :c).merge(A.where(company_id: company_id)) if company_id.present? | |
} |
This file contains 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
# Hello World | |
This is content converted from Markdown! | |
Here's a JSON sample: | |
```json | |
{ | |
"foo": "bar" | |
} |
This file contains 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
<html> | |
<head> | |
<style> | |
h1 { | |
font-family: Calibri; | |
} | |
</style> | |
</head> | |
<body> | |
<h1>Hello World!</h1> |