Skip to content

Dupe.define :address bugs out #12

@nzifnab

Description

@nzifnab

When trying to define a dupe of 'address' it doesn't seem to be interpreting it correctly (maybe something to do with the pluralization parser?)

>> Dupe.define :address do |addr|
?>   addr.name
>>   addr.uniquify :address1
>>   addr.address2
>>   addr.city "Denver"
>>   addr.region "CO"
>>   addr.postal_code "55555"
>>   addr.phone "5554443210"
>>   addr.phone2
>>   addr.fax
>>   addr.main_address false
>>   addr.addressable_id {Dupe.create(:profile).id}
>>   addr.addressable_type "Profile"
>>   addr.lat
>>   addr.lng
>> end

>> Dupe.create(:address)
=> <#Duped::Addres id=1>

Notice how it's stripping one of the 's' characters off the end of the created object, and not reading in any of the default properties defined.

However, when I add an extra 's'... it decides to create the object properly.

>> Dupe.create(:addresss) # Notice the three 's' characters
=> <#Duped::Address lng=nil city="Denver" main_address=false region="CO" addressable_id=<#Duped::Profile id=1> postal_code="80234" name=nil phone="5554443210" address1="address 1 address1" addressable_type="Profile" phone2=nil lat=nil address2=nil id=1 fax=nil>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions