Class: Lit::Source
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Lit::Source
- Defined in:
- app/models/lit/source.rb
Constant Summary collapse
- LOCALES_PATH =
'/api/v1/locales.json'.freeze
- LOCALIZATION_KEYS_PATH =
'/api/v1/localization_keys.json'.freeze
- LOCALIZATIONS_PATH =
'/api/v1/localizations.json'.freeze
- LAST_CHANGE_PATH =
'/api/v1/last_change.json'.freeze
Instance Method Summary collapse
-
#api_key ⇒ Object
VALIDATIONS.
- #assign_last_updated_at(time = nil) ⇒ Object
-
#incomming_localizations ⇒ Object
ASSOCIATIONS.
- #last_change ⇒ Object
- #touch_last_updated_at! ⇒ Object
Instance Method Details
#api_key ⇒ Object
VALIDATIONS
13 14 |
# File 'app/models/lit/source.rb', line 13 validates :api_key, :identifier, :url, presence: true |
#assign_last_updated_at(time = nil) ⇒ Object
37 38 39 |
# File 'app/models/lit/source.rb', line 37 def assign_last_updated_at(time = nil) self.last_updated_at = time || Time.now end |
#incomming_localizations ⇒ Object
ASSOCIATIONS
10 |
# File 'app/models/lit/source.rb', line 10 has_many :incomming_localizations |
#last_change ⇒ Object
27 28 29 30 |
# File 'app/models/lit/source.rb', line 27 def last_change result = RemoteInteractorService.new(self).send_request(LAST_CHANGE_PATH) result['last_change'] unless result.nil? end |
#touch_last_updated_at! ⇒ Object
32 33 34 35 |
# File 'app/models/lit/source.rb', line 32 def touch_last_updated_at! assign_last_updated_at save end |