mirror of
https://github.com/Fishwaldo/huginn.git
synced 2025-03-15 19:31:26 +00:00
Check the presence of service in twitter_oauth_token & twitter_oauth_token_secret.
This commit is contained in:
parent
f85b82a043
commit
0aca3a074d
1 changed files with 2 additions and 3 deletions
|
@ -13,7 +13,6 @@ module TwitterConcern
|
|||
def validate_twitter_options
|
||||
unless twitter_consumer_key.present? &&
|
||||
twitter_consumer_secret.present? &&
|
||||
service &&
|
||||
twitter_oauth_token.present? &&
|
||||
twitter_oauth_token_secret.present?
|
||||
errors.add(:base, "Twitter consumer_key, consumer_secret, oauth_token, and oauth_token_secret are required to authenticate with the Twitter API. You can provide these as options to this Agent, or as Credentials with the same names, but starting with 'twitter_'.")
|
||||
|
@ -29,11 +28,11 @@ module TwitterConcern
|
|||
end
|
||||
|
||||
def twitter_oauth_token
|
||||
service.token
|
||||
service && service.token
|
||||
end
|
||||
|
||||
def twitter_oauth_token_secret
|
||||
service.secret
|
||||
service && service.secret
|
||||
end
|
||||
|
||||
def twitter
|
||||
|
|
Loading…
Add table
Reference in a new issue