Class: Kennel::Models::Record
Constant Summary collapse
- LOCK =
"\u{1F512}"- READONLY_ATTRIBUTES =
[ :deleted, :id, :created, :created_at, :creator, :org_id, :modified, :modified_at, :api_resource ].freeze
- REQUEST_DEFAULTS =
{ style: { width: "normal", palette: "dog_classic", type: "solid" }, conditional_formats: [], aggregator: "avg" }.freeze
- API_LIST_INCOMPLETE =
false
Constants inherited from Base
Base::SETTING_OVERRIDABLE_METHODS
Constants included from SettingsAsMethods
SettingsAsMethods::SETTING_OVERRIDABLE_METHODS
Instance Attribute Summary collapse
-
#project ⇒ Object
readonly
Returns the value of attribute project.
Instance Method Summary collapse
- #diff(actual) ⇒ Object
-
#initialize(project, *args) ⇒ Record
constructor
A new instance of Record.
- #resolve_linked_tracking_ids ⇒ Object
- #tracking_id ⇒ Object
Methods inherited from Base
Methods included from SubclassTracking
#recursive_subclasses, #subclasses
Methods included from SettingsAsMethods
Constructor Details
#initialize(project, *args) ⇒ Record
Returns a new instance of Record.
57 58 59 60 61 |
# File 'lib/kennel/models/record.rb', line 57 def initialize(project, *args) raise ArgumentError, "First argument must be a project, not #{project.class}" unless project.is_a?(Project) @project = project super(*args) end |
Instance Attribute Details
#project ⇒ Object (readonly)
Returns the value of attribute project.
55 56 57 |
# File 'lib/kennel/models/record.rb', line 55 def project @project end |
Instance Method Details
#diff(actual) ⇒ Object
63 64 65 66 67 68 69 70 |
# File 'lib/kennel/models/record.rb', line 63 def diff(actual) expected = as_json expected.delete(:id) self.class.send(:normalize, expected, actual) HashDiff.diff(actual, expected, use_lcs: false) end |
#resolve_linked_tracking_ids ⇒ Object
76 77 |
# File 'lib/kennel/models/record.rb', line 76 def resolve_linked_tracking_ids(*) end |
#tracking_id ⇒ Object
72 73 74 |
# File 'lib/kennel/models/record.rb', line 72 def tracking_id "#{project.kennel_id}:#{kennel_id}" end |