Advertisement
Guest User

Untitled

a guest
May 11th, 2016
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. require 'active_resource'
  2.  
  3. class User < ActiveResource::Base
  4. self.site = 'http://localhost:3000/api/v2'
  5. self.include_format_in_path = false
  6.  
  7. schema do
  8. attribute :id, :integer
  9. attribute :name, :string
  10. attribute :password, :string
  11. attribute :email, :string
  12. attribute :email_confirmation, :string
  13. end
  14.  
  15. validates :email, confirmation: true
  16. end
  17.  
  18. user = User.new(
  19. name: 'My name',
  20. email: 'an@email.com',
  21. email_confirmation: 'another@email.com',
  22. password: 'some_password'
  23. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement