Advertisement
Guest User

Untitled

a guest
Dec 19th, 2016
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. module A
  2. class B < ActiveRecord::Base
  3. end
  4. end
  5.  
  6. require 'active_record'
  7. ActiveRecord::Base.establish_connection(
  8. adapter: 'postgresql',
  9. database: 'xxxx',
  10. host: 'localhost',
  11. username: 'xxxx',
  12. password: 'xxxx'
  13. )
  14.  
  15. module A
  16. class B < ActiveRecord::Base
  17. def self.do_something
  18. A::B.all.each do |record|
  19. #do something
  20. end
  21. end
  22. end
  23. end
  24. end
  25.  
  26. A::B.do_something
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement