Module: CurlyMustache::Attributes

Included in:
Base
Defined in:
lib/curly_mustache/attributes.rb,
lib/curly_mustache/attributes/types.rb,
lib/curly_mustache/attributes/manager.rb,
lib/curly_mustache/attributes/definition.rb

Overview

It looks like typecasting happens at assignment for ActiveRecord, so we’re just going to follow that.

user.account_id = "test"
user.account_id
=> 0

Defined Under Namespace

Modules: ClassMethods, InstanceMethods, Types Classes: Definition, Manager

Class Method Summary collapse

Class Method Details

.included(mod) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/curly_mustache/attributes.rb', line 11

def self.included(mod)
  mod.class_eval do
    class_inheritable_accessor :attribute_manager
    class_inheritable_accessor :allow_settable_id
  end
  mod.attribute_manager = Manager.new
  mod.send(:extend,  ClassMethods)
  mod.send(:include, InstanceMethods)
end