Skip to content

Instantly share code, notes, and snippets.

@mrchrisadams
Created September 19, 2009 10:33
Show Gist options
  • Save mrchrisadams/189456 to your computer and use it in GitHub Desktop.
Save mrchrisadams/189456 to your computer and use it in GitHub Desktop.
/* line 37 and 27 here are eerily empty, and I dont know why, because they're populated in the params hash */
--- !ruby/object:User
accept_tos: "1"
attributes:
occupation:
last_login_at:
image_file_size:
avatar_file_size:
avatar_file_name:
dob: 1985-09-19 00:00:00 Z
updated_at:
last_request_at:
crypted_password: 674380e9866d2e28f5ceabef78c7f41577638b12c9200ead939b12f4cec216bb3adefd0ca476c61aa054c71f5e833d5588b8d43174e99ad51d1bb601e782b5fa
postcode:
current_login_ip:
perishable_token:
single_access_token:
admin: false
notify_suggestion: true
current_login_at:
password_salt: xjB8U0biNr2scJZSyE4B
image_content_type:
/* important line*/
country:
failed_login_count: 0
avatar_content_type:
from_old_nag: false
monthly_nagging: "0"
login_count: 0
persistence_token: 501e79cc722a071e638fca3e7421a0ba53d421f1166e50d82d49644f11d7fc830b39a5e65a7afa691cc5e81579b9065497b2fc1daa290452da3a261e96164316
newsletter: "0"
/* other important line*/
town:
hotness:
first_name: firstname
notify_story: true
income:
age:
notify_member: true
notify_comment: true
image_updated_at:
last_name: lastname
user_name: username
active: false
created_at:
last_login_ip:
image_file_name:
location:
email:
attributes_cache: {}
changed_attributes:
dob:
crypted_password:
password_salt:
persistence_token:
newsletter:
first_name:
last_name:
user_name:
country: United Kingdom
email_domain: addy.com
email_name: "1"
new_record: true
password: password
password_changed: true
password_confirmation: password
town: london
# created like so - user1 = User.new(params[:user])
(rdb:53) y user1
--- !ruby/object:User
accept_tos: "1"
attributes:
introduced_to_new_nag: false
occupation:
last_login_at:
image_file_size:
avatar_file_size:
avatar_file_name:
dob: 1985-09-19 00:00:00 Z
updated_at:
last_request_at:
crypted_password: fcb77d7f84a2b54d9fc39ba61e8c829d1eb2176de2c766b3474b91b6f1dfa205e3e902c02b575f54aeb26c1ca2a0045e0e4757cceea4999e904351811f9f1f2a
postcode:
current_login_ip:
perishable_token:
single_access_token:
admin: false
ethnic_origin:
notify_suggestion: true
current_login_at:
password_salt: jHMpaLJHYIf7cPFgB5Zj
image_content_type:
country:
failed_login_count: 0
avatar_content_type:
from_old_nag: false
monthly_nagging: "0"
login_count: 0
persistence_token: 0a96a6ea7dde83e38dbe517d981876d6dd429c59204ffd19dd76474c6f7db3664ea79e1fac3de585c1e96d8e108875ed5dc68b3d64d3b2b0ebc715fe502c5240
newsletter: "0"
town:
hotness:
first_name: firstname
notify_story: true
income:
age:
notify_member: true
notify_comment: true
image_updated_at:
last_name: lastname
user_name: username
active: false
created_at:
last_login_ip:
image_file_name:
location:
email:
attributes_cache: {}
changed_attributes:
dob:
crypted_password:
password_salt:
persistence_token:
newsletter:
monthly_nagging:
first_name:
last_name:
user_name:
country: United Kingdom
email_domain: addy.com
email_name: "1"
new_record: true
password: password
password_changed: true
password_confirmation: password
town: london
nil
--- !map:HashWithIndifferentAccess
accept_tos: "1"
email_name: "1"
password_confirmation: password
country: United Kingdom
dob(1i): "1985"
dob(2i): "9"
dob(3i): "19"
email_domain: addy.com
town: london
monthly_nagging: "0"
newsletter: "0"
first_name: firstname
user_name: username
last_name: lastname
password: password
# relevant schema fragment
create_table "users", :force => true do |t|
t.string "user_name"
t.string "first_name"
t.string "last_name"
t.string "email"
t.string "location"
t.string "town"
t.string "country"
t.string "postcode"
t.boolean "newsletter"
# debuggers added to see what's going on here
def create
debugger
@user = User.new params[:user]
debugger
if @user.save_without_session_maintenance
@user.deliver_activation_instructions!
flash[:notice] = "Your account has been created. Please check your e-mail for your account activation instructions!"
redirect_to root_url
else
render :action => :new
end
debugger
end
class User < ActiveRecord::Base
# lots of code
attr_protected :admin, :active
# relevant accessor methods
attr_accessor :town, :postcode, :country
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment