Skip to content

Commit

Permalink
fix: add lazy load hook on client and small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bibendi committed Aug 5, 2015
1 parent 015c863 commit eba14a6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions app/models/apress/api/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ def generate_refresh_token
def set_refresh_token_expiration
self.refresh_token_expire_at = Rails.application.config.api[:refresh_token_ttl].from_now
end

ActiveSupport.run_load_hooks(:"apress/api/client", self)
end
end
end
4 changes: 2 additions & 2 deletions apress-api.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ Gem::Specification.new do |spec|
spec.require_paths = ["lib"]

spec.add_runtime_dependency "rails", ">= 3.1.0"
spec.add_runtime_dependency "pg", ">= 0.18.2"
spec.add_runtime_dependency "pg", ">= 0.16"
spec.add_runtime_dependency "api-auth", ">= 1.3.1"
spec.add_runtime_dependency "oj", ">= 2.12.10"
spec.add_runtime_dependency "oj", ">= 2.9.9"
spec.add_runtime_dependency "multi_json", ">= 1.11.2"
spec.add_runtime_dependency "jbuilder", ">= 2.3.1"
spec.add_runtime_dependency "attr_extras", ">= 4.4.0"
Expand Down
2 changes: 2 additions & 0 deletions lib/apress/api/api_controller/compatibility.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ def allow_forgery_protection=(*); end
def helper_method(*); end

def helper(*); end

def include_all_helpers=(*); end
# :nocov:
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/apress/api/api_controller/rescue.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Rescue
extend ActiveSupport::Concern

included do
rescue_from "Exception", :server_error if Rails.env.production?
rescue_from "Exception", with: :server_error if Rails.env.production?

rescue_from(
"ActiveRecord::RecordNotFound",
Expand Down

0 comments on commit eba14a6

Please sign in to comment.