ruby的一些方法


irb(main):015:0> u = User.first
irb(main):016:0> u.methods.select{|x| x.to_s.include?('email')}
=> [:email_required?, :send_email_changed_notification?, :send_email_changed_notification, :skip_email_changed_notification!, :email_before_last_save, :email_was, :saved_change_to_email?, :email_changed?, :will_save_change_to_email?, :email_before_type_cast, :email_for_database, :email_came_from_user?, :email?, :email_change, :email_will_change!, :email_previously_changed?, :email_previous_change, :email_previously_was, :restore_email!, :clear_email_change, :saved_change_to_email, :email_change_to_be_saved, :email_in_database, :email, :unconfirmed_email=, :unconfirmed_email_for_database, :unconfirmed_email_came_from_user?, :unconfirmed_email?, :unconfirmed_email_changed?, :unconfirmed_email_change, :unconfirmed_email_before_type_cast, :unconfirmed_email_was, :unconfirmed_email_previously_changed?, :unconfirmed_email_previous_change, :unconfirmed_email_previously_was, :restore_unconfirmed_email!, :unconfirmed_email_will_change!, :saved_change_to_unconfirmed_email?, :saved_change_to_unconfirmed_email, :unconfirmed_email_before_last_save, :will_save_change_to_unconfirmed_email?, :unconfirmed_email_change_to_be_saved, :clear_unconfirmed_email_change, :unconfirmed_email, :unconfirmed_email_in_database, :email=]

阅读量: 645
发布于:
修改于: