I have a model User that belongs_to EmailAddress (I know that seems
backwards, but that’s the way it really is). In one of the views, I’m
calling @user.email_address.verified?, where the verified? method is
indeed defined in the EmailAddress class. I’ve been working on a
checkout of Edge Rails (rev. 5379), where this works, as it does in
1.1.6. When running 1.2RC, it gives a NoMethodError on verified? only
AFTER the first time. So, it works once, but if you refresh the page,
it dies. When I log the methods on the instance, the first time
around, I get:
==, ===, =~, [], []=, id, send, `, after_create,
after_destroy, after_save, after_update, after_validation,
after_validation_on_create, after_validation_on_update,
allow_concurrency, allow_concurrency=, attribute_names,
attribute_present?, attributes, attributes=,
attributes_before_type_cast, attributes_from_column_definition,
attributes_from_column_definition_with_lock, b64encode, before_create,
before_destroy, before_save, before_update, before_validation,
before_validation_on_create, before_validation_on_update, blank?,
build_registration_invitation, build_user, class,
clear_aggregation_cache, clear_association_cache, clone,
colorize_logging, colorize_logging=, column_for_attribute,
configurations, configurations=, connection,
copy_instance_variables_from, create, create_or_update,
create_or_update_with_callbacks, create_registration_invitation,
create_user, create_with_callbacks, create_with_timestamps,
create_without_timestamps, daemonize, dclone, decode64, decode_b,
decrement, decrement!, default_timezone, default_timezone=, destroy,
destroy_with_callbacks, destroy_with_transactions,
destroy_without_callbacks, destroy_without_transactions, display, dup,
enable_warnings, encode64, eql?, equal?, errors, extend,
extend_with_included_modules_from, extended_by, freeze, frozen?,
generate_key, generate_read_methods, generate_read_methods=,
has_attribute?, has_registration_invitation?,
has_registration_invitation_with_deprecation?,
has_registration_invitation_without_deprecation?, has_user?,
has_user_with_deprecation?, has_user_without_deprecation?, hash, id,
id=, id_before_type_cast, increment, increment!, initialize,
initialize_with_callbacks, inspect, instance_eval, instance_exec,
instance_of?, instance_values, instance_variable_get,
instance_variable_set, instance_variables, is_a?, kind_of?, load,
lock!, lock_optimistically, lock_optimistically=, locking_enabled?,
logger, logger=, method, methods, new_record?, nil?, object_id,
pluralize_table_names, pluralize_table_names=,
primary_key_prefix_type, primary_key_prefix_type=, private_methods,
protected_methods, public_methods, quote, quote_with_deprecation,
quoted_id, readonly!, readonly?, record_timestamps,
record_timestamps=, registration_invitation, registration_invitation=,
registration_invitation?, registration_invitation_with_deprecation?,
registration_invitation_without_deprecation?, reload,
remove_subclasses_of, require, require_gem, require_gem_with_options,
require_library_or_gem, respond_to?, respond_to_without_attributes?,
returning, save, save!, save_with_transactions,
save_with_transactions!, save_with_validation, save_with_validation!,
save_without_transactions, save_without_transactions!,
save_without_validation, save_without_validation!, schema_format,
schema_format=, send, set_registration_invitation_target,
set_user_target, silence_stderr, silence_stream, silence_warnings,
singleton_methods, subclasses_of, suppress, table_name_prefix,
table_name_prefix=, table_name_suffix, table_name_suffix=, taguri,
taguri=, taint, tainted?, to_a, to_json, to_param, to_s, to_xml,
to_yaml, to_yaml_properties, to_yaml_style, toggle, toggle!,
transaction, type, unloadable, untaint, update, update_attribute,
update_attribute_with_validation_skipping,
update_attribute_without_validation_skipping, update_attributes,
update_attributes!, update_with_callbacks, update_with_lock,
update_with_timestamps, update_without_callbacks,
update_without_timestamps, user, user=, user?, user_with_deprecation?,
user_without_deprecation?, valid?, valid_with_callbacks?,
valid_without_callbacks?, validate, validate_on_create,
validate_on_update, verification_timeout, verification_timeout=,
verified?, verify_key, verify_key!, with_options
You can clearly see the verified method there. The very next time
through, I get:
==, ===, =~, [], []=, id, send, `, after_create,
after_destroy, after_save, after_update, after_validation,
after_validation_on_create, after_validation_on_update,
allow_concurrency, allow_concurrency=, attribute_names,
attribute_present?, attributes, attributes=,
attributes_before_type_cast, attributes_from_column_definition,
attributes_from_column_definition_with_lock, b64encode, before_create,
before_destroy, before_save, before_update, before_validation,
before_validation_on_create, before_validation_on_update, blank?,
class, clear_aggregation_cache, clear_association_cache, clone,
colorize_logging, colorize_logging=, column_for_attribute,
configurations, configurations=, connection,
copy_instance_variables_from, create, create_or_update,
create_or_update_with_callbacks, create_with_callbacks,
create_with_timestamps, create_without_timestamps, daemonize, dclone,
decode64, decode_b, decrement, decrement!, default_timezone,
default_timezone=, destroy, destroy_with_callbacks,
destroy_with_transactions, destroy_without_callbacks,
destroy_without_transactions, display, dup, enable_warnings, encode64,
eql?, equal?, errors, extend, extend_with_included_modules_from,
extended_by, freeze, frozen?, generate_read_methods,
generate_read_methods=, has_attribute?, hash, id, id=,
id_before_type_cast, increment, increment!, initialize,
initialize_with_callbacks, inspect, instance_eval, instance_exec,
instance_of?, instance_values, instance_variable_get,
instance_variable_set, instance_variables, is_a?, kind_of?, load,
lock!, lock_optimistically, lock_optimistically=, locking_enabled?,
logger, logger=, method, methods, new_record?, nil?, object_id,
pluralize_table_names, pluralize_table_names=,
primary_key_prefix_type, primary_key_prefix_type=, private_methods,
protected_methods, public_methods, quote, quote_with_deprecation,
quoted_id, readonly!, readonly?, record_timestamps,
record_timestamps=, reload, remove_subclasses_of, require,
require_gem, require_gem_with_options, require_library_or_gem,
respond_to?, respond_to_without_attributes?, returning, save, save!,
save_with_transactions, save_with_transactions!, save_with_validation,
save_with_validation!, save_without_transactions,
save_without_transactions!, save_without_validation,
save_without_validation!, schema_format, schema_format=, send,
silence_stderr, silence_stream, silence_warnings, singleton_methods,
subclasses_of, suppress, table_name_prefix, table_name_prefix=,
table_name_suffix, table_name_suffix=, taguri, taguri=, taint,
tainted?, to_a, to_json, to_param, to_xml, to_yaml,
to_yaml_properties, to_yaml_style, toggle, toggle!, transaction, type,
unloadable, untaint, update, update_attribute,
update_attribute_with_validation_skipping,
update_attribute_without_validation_skipping, update_attributes,
update_attributes!, update_with_callbacks, update_with_lock,
update_with_timestamps, update_without_callbacks,
update_without_timestamps, valid?, valid_with_callbacks?,
valid_without_callbacks?, validate, validate_on_create,
validate_on_update, verification_timeout, verification_timeout=,
with_options
I don’t know why, but there it is. Has anyone else seen this?
–
–Scott