Working on this now... should have a pull request by this weekend.
I wanted to get feedback if the following structure was ok for adding Mass Assignment support.
I figured unlike ActiveRecord we need to explicitly state what attributes exist in the model for Couchbase-Model.
If we then wanted to define what attributes are accessible or protected we would follow the expected convention from ActiveModel::MassAssignmentSecurity.
require 'couchbase/model'
class Post < Couchbase::Model
attribute :title
attribute :body
attribute :draft
attr_accessible :title, :as => admin
attr_accessible :body, :as => user
end
And to Save if you needed to provide a role you could as part of the options hash
Working on this now... should have a pull request by this weekend.
I wanted to get feedback if the following structure was ok for adding Mass Assignment support.
I figured unlike ActiveRecord we need to explicitly state what attributes exist in the model for Couchbase-Model.
If we then wanted to define what attributes are accessible or protected we would follow the expected convention from ActiveModel::MassAssignmentSecurity.
And to Save if you needed to provide a role you could as part of the options hash