开发者

What is the "key" attribute keyword for in rails?

开发者 https://www.devze.com 2023-03-01 06:04 出处:网络
In diaspora, there is a class that includes the code below, however I can\'t find any documentation on what the \"key\" keyword is or how it is used.Any help?Thanks!

In diaspora, there is a class that includes the code below, however I can't find any documentation on what the "key" keyword is or how it is used. Any help? Thanks!

Person.rb

class Person 
  #omitted for clarity 
  key :url,     String 
  key :diaspora_handle, String, :unique => true 
  key :serialized_key, String #Public/private key pair for encryption. 
  key :owner_id, ObjectId #Extraordinarily security sensitive because... 

  one :profile, :class_name => 'Profile' 
  many :albums, :class_name => 'Album', :foreign_key => :person_id 
  belongs_to :owner, :class_name => 'Use开发者_StackOverflowr' #... changing it reassigns account ownership!
end 


Diaspora uses MongoDB instead of a SQL database. As such, instead of using ActiveRecord it uses MongoMapper. The models are declared differently.

http://mongomapper.com/

https://github.com/jnunemaker/mongomapper

0

精彩评论

暂无评论...
验证码 换一张
取 消