activemodel 7.1.5.2
“A toolkit for building modeling frameworks like Active Record. Rich support for attributes, callbacks, validations, serialization, internat…”
At least four Markdown section headingsRuby bitwise XOR expression
SHA-2564fb6a56a8614ee820c218563fcdebcf0d7b16ab153b81ecd2ed91877cf4ac8b5
MaleculeH₆(CmCrDb₆Os₂Po)Md₃(InPa)
Evidence
⋯5 lines
65 module Callbacks
66 def self.extended(base) # :nodoc:
67 base.class_eval do
68 include ActiveSupport::Callbacks
69 end
70 end
71
72 # +define_model_callbacks+ accepts the same options +de …
⋯7 lines
121
122 types.each do |type|
123 send("_define_#{type}_model_callback", self, callback)
124 end
125 end
⋯4 lines
180:48… "
181
182 {Learn more}[link:classes/ActiveModel/Serialization.html]
183
184* Internationalization (i18n) support
185
186 class Person
187 extend ActiveModel::Translation
188 end
189
190 Person.human_attribute_name('my_attribute')
191 # => "My attribute"
192
⋯5 lines
241
242Source code can be downloaded as part of the \Rails project on GitHub
243
244* https://github.com/rails/rails/tree/main/activemodel
245
246
⋯5 lines
1# frozen_string_literal: true
2
3require "active_support/core_ext/hash/keys"
4
5module ActiveModel
6 module AttributeAssignment
7 include ActiveModel::ForbiddenAttributesProtection
8
9 # Allows you to set all the attributes by passing in a hash of attributes with
10 # keys matching the attribute names.
11 #
12 # If the passed hash responds to <tt>permitted?</tt> method and the return value
13 # of this method is +false+ an ActiveModel::ForbiddenAttributesError
14 # exception is raised.
15 #
⋯33 lines
No evidence locations were recorded for this file. Raw result