Class: UUCounter::Track
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- UUCounter::Track
- Defined in:
- app/models/uu_counter/track.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
Returns the value of attribute path.
-
#uuid ⇒ Object
Returns the value of attribute uuid.
Instance Method Summary collapse
Instance Attribute Details
#path ⇒ Object
Returns the value of attribute path.
3 4 5 |
# File 'app/models/uu_counter/track.rb', line 3 def path @path end |
#uuid ⇒ Object
Returns the value of attribute uuid.
3 4 5 |
# File 'app/models/uu_counter/track.rb', line 3 def uuid @uuid end |
Instance Method Details
#record ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'app/models/uu_counter/track.rb', line 8 def record past_track = Track.find(uuid: self.uuid, path: self.path) if past_track return { 'status': 'Already the user accessed to the page.' } end if self.save return { 'status': 'The access track was successfully saved.' } else return { 'status': "The access track couldn't be saved." } end end |