activeentity 0.0.1.beta16 → 0.0.1.beta17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66d3aead74bfd3d5a8162e8da72f63337a598842e7aaabf5d3ddc8bcf03ccba7
|
4
|
+
data.tar.gz: 4a5bde329a590399e6c890279b9d702463bec7da3cd9df0fae84eb188949b6a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e268f4ff1d308b223e767a5836c9eb158ff4d8648dfdd960426434da4caff1a7ff278923a79d4f1f73f97e4bbeabfdac9e69dbf437f893c59dfac91ab80b868
|
7
|
+
data.tar.gz: '049773f1db811952efeec0f186c6c7306937783b38c719f466f2c3ffc93c353da1b9f8be16f445223b4582e08e731fefe2217689bccb2ea9c1a3bf597561bbc8'
|
@@ -13,6 +13,7 @@ module ActiveEntity
|
|
13
13
|
generated_attribute_methods, name
|
14
14
|
) do |temp_method_name, attr_name_expr|
|
15
15
|
generated_attribute_methods.module_eval <<-RUBY, __FILE__, __LINE__ + 1
|
16
|
+
# frozen_string_literal: true
|
16
17
|
def #{temp_method_name}
|
17
18
|
name = #{attr_name_expr}
|
18
19
|
_read_attribute(name) { |n| missing_attribute(n, caller) }
|
@@ -15,8 +15,9 @@ module ActiveEntity
|
|
15
15
|
def define_method_attribute=(name)
|
16
16
|
ActiveModel::AttributeMethods::AttrNames.define_attribute_accessor_method(
|
17
17
|
generated_attribute_methods, name, writer: true,
|
18
|
-
|
18
|
+
) do |temp_method_name, attr_name_expr|
|
19
19
|
generated_attribute_methods.module_eval <<-RUBY, __FILE__, __LINE__ + 1
|
20
|
+
# frozen_string_literal: true
|
20
21
|
def #{temp_method_name}(value)
|
21
22
|
name = #{attr_name_expr}
|
22
23
|
_write_attribute(name, value)
|
@@ -39,8 +40,6 @@ module ActiveEntity
|
|
39
40
|
# This method exists to avoid the expensive primary_key check internally, without
|
40
41
|
# breaking compatibility with the write_attribute API
|
41
42
|
def _write_attribute(attr_name, value) # :nodoc:
|
42
|
-
return if readonly_attribute?(attr_name) && attr_readonly_enabled?
|
43
|
-
|
44
43
|
@attributes.write_from_user(attr_name.to_s, value)
|
45
44
|
value
|
46
45
|
end
|
data/lib/active_entity/base.rb
CHANGED
@@ -6,7 +6,6 @@ require "active_support/descendants_tracker"
|
|
6
6
|
require "active_support/time"
|
7
7
|
require "active_support/core_ext/class/subclasses"
|
8
8
|
require "active_entity/attribute_decorators"
|
9
|
-
require "active_entity/define_callbacks"
|
10
9
|
require "active_entity/attributes"
|
11
10
|
|
12
11
|
module ActiveEntity #:nodoc:
|
@@ -280,7 +279,6 @@ module ActiveEntity #:nodoc:
|
|
280
279
|
include Validations
|
281
280
|
include Attributes
|
282
281
|
include AttributeDecorators
|
283
|
-
include DefineCallbacks
|
284
282
|
include AttributeMethods
|
285
283
|
include Callbacks
|
286
284
|
include Associations
|
@@ -1,13 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module ActiveEntity
|
4
|
-
|
5
|
-
# define callbacks, but continue to have its version of +save+ be the super
|
6
|
-
# method of ActiveEntity::Callbacks. This will be removed when the removal
|
7
|
-
# of deprecated code removes this need.
|
8
|
-
module DefineCallbacks
|
4
|
+
module Callbacks
|
9
5
|
extend ActiveSupport::Concern
|
10
6
|
|
7
|
+
CALLBACKS = [
|
8
|
+
:after_initialize, :before_validation, :after_validation
|
9
|
+
]
|
10
|
+
|
11
11
|
module ClassMethods # :nodoc:
|
12
12
|
include ActiveModel::Callbacks
|
13
13
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activeentity
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.1.
|
4
|
+
version: 0.0.1.beta17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jasl
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-04-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -89,10 +89,10 @@ files:
|
|
89
89
|
- lib/active_entity/attribute_methods/write.rb
|
90
90
|
- lib/active_entity/attributes.rb
|
91
91
|
- lib/active_entity/base.rb
|
92
|
+
- lib/active_entity/callbacks.rb
|
92
93
|
- lib/active_entity/coders/json.rb
|
93
94
|
- lib/active_entity/coders/yaml_column.rb
|
94
95
|
- lib/active_entity/core.rb
|
95
|
-
- lib/active_entity/define_callbacks.rb
|
96
96
|
- lib/active_entity/enum.rb
|
97
97
|
- lib/active_entity/errors.rb
|
98
98
|
- lib/active_entity/gem_version.rb
|