This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
action_base = ActionController::Base.new | |
key = "en/handlebars_ticket_filter_show_v2/ssl:false" | |
action_base.fragment_exist?(key) | |
action_base.read_fragment(key) | |
action_base.fragment_cache_key(key) # shows how Rails modifies the key before storage see ActiveSupport::Cache.expand_cache_key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers | |
ActiveSupport::Notifications.subscribe /fragment.action_controller/ do |*args| | |
event = ActiveSupport::Notifications::Event.new *args | |
Rails.logger.info "Notification for event #{event.name} with payload #{event.payload}" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package desk | |
import ( | |
"fmt" | |
"testing" | |
. "github.com/smartystreets/goconvey/convey" | |
) | |
func TestJsonBuilder(t *testing.T) { | |
fmt.Println("") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package desk | |
import ( | |
"github.com/lann/builder" | |
) | |
type StructA struct { | |
Name *string | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Not very DRY at all, there should be a better way... | |
type Case struct { | |
ID *int `json:"id,omitempty"` | |
ExternalID *string `json:"external_id,omitempty"` | |
Type *string `json:"type,omitempty"` | |
} | |
type caseBuilder builder.Builder | |
func (b caseBuilder) Build() Case { | |
return builder.GetStruct(b).(Case) |
NewerOlder