https://github.com/work-design/rails_extend
Rails 框架核心库拓展
https://github.com/work-design/rails_extend
Last synced: 4 months ago
JSON representation
Rails 框架核心库拓展
- Host: GitHub
- URL: https://github.com/work-design/rails_extend
- Owner: work-design
- Created: 2021-09-06T09:13:28.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2023-12-14T04:57:26.000Z (over 2 years ago)
- Last Synced: 2025-03-08T09:39:23.187Z (over 1 year ago)
- Language: Ruby
- Homepage:
- Size: 256 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# RailsExtend
[](https://github.com/work-design/rails_extend/actions/workflows/test.yml)
[](https://github.com/work-design/rails_extend/actions/workflows/cd.yml)
[](https://github.com/work-design/rails_extend/actions/workflows/gempush.yml)
Rails 通用基础库,对 Rails 的各个组件进行了扩展。
## 功能模块
* Ruby 核心类扩展,[链接](lib/rails_extend/core)
* Rails 核心类扩展
* ActiveStorage:[链接](lib/rails_com/active_storage)
* 通过 url 同步文件;
* 将文件复制到镜像服务器;
* Rails 元信息:
* [Model](lib/rails_extend/models.rb)
* [Routes / Controllers](lib/rails_extend/routes)
## 支持 enum
```yaml
# zh.yml
activerecord:
enum:
notification:
receiver_type:
User: 全体用户
Member: 成员
```
```ruby
t.select :receiver_type, options_for_select(Notification.options_i18n(:receiver_type))
```
* Override
```yaml
activerecord:
enum:
notification:
receiver_type:
User: 全体用户
Member: # remain this blank
```
## 版权
遵循 [MIT](LICENSE) 协议