zoukankan      html  css  js  c++  java
  • 在lib下编写的自己的类需要用到model内相关方法

    我们在lib下编写的自己的类需要用到model内相关方法时,需要如下设置:

    require_relative 'boot'
    
    require 'rails/all'
    
    # Require the gems listed in Gemfile, including any gems
    # you've limited to :test, :development, or :production.
    Bundler.require(*Rails.groups)
    
    module DomesticTrade
      class Application < Rails::Application
        # Settings in config/environments/* take precedence over those specified here.
        # Application configuration should go into files in config/initializers
        # -- all .rb files in that directory are automatically loaded.
        config.autoload_paths += [
          Rails.root.join('lib')
        ]
        config.eager_load_paths += [
          Rails.root.join('lib/coin_deal_api')
        ]
      end
    end
    
    
  • 相关阅读:
    jdbc基础
    DAO模式(单表)
    window对象
    抽象类VS接口
    sql语句
    JS弹框计算
    HBML表单
    【mysql】:mysql性能优化总结
    【java】:多线程面试题
    spring multipart源码分析:
  • 原文地址:https://www.cnblogs.com/dccmmtop/p/7514183.html
Copyright © 2011-2022 走看看