Created
November 24, 2008 00:17
-
-
Save julesfern/28330 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The code: | |
class MerbAuthSliceFullfat::AuthenticatingClient | |
include DataMapper::Resource | |
# Key it | |
property :id, Serial | |
# The registration will belong to a user, who will be able to edit the client properties. | |
property :user_id, Integer, :writer => :protected | |
end | |
# The problem: | |
>> c = AuthenticatingClient.new | |
=> #<MerbAuthSliceFullfat::AuthenticatingClient id=nil user_id=nil name=nil web_url=nil icon_url=nil api_key=nil secret=nil kind=nil callback_url=nil> | |
>> c.attributes = {:user_id=>10} | |
=> {:user_id=>10} | |
>> c.inspect | |
=> "#<MerbAuthSliceFullfat::AuthenticatingClient id=nil user_id=10 name=nil web_url=nil icon_url=nil api_key=nil secret=nil kind=nil callback_url=nil>" | |
>> c.user_id = 10 | |
NoMethodError: protected method `user_id=' called for #<MerbAuthSliceFullfat::AuthenticatingClient:0x2574b60> | |
from (irb):5 | |
from :0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment