Sha256: fb155b3e1f554bebec75cb681a933778203c0fecf58e8127308b431d9f8a2c29
Contents?: true
Size: 1.19 KB
Versions: 1
Compression:
Stored size: 1.19 KB
Contents
module Journey class Resource < ActiveResource::Base def self.find(*arguments) scope = arguments.slice!(0) options = arguments.slice!(0) || {} self.embeds ||= [] unless options.has_key?(:embed) && !options.delete(:embed) options.deep_merge!(params: { embed: embeds }) end super *([scope, options] + arguments) end def self.where(clauses={}) raise ArgumentError, "expected a clauses Hash, got #{clauses.inspect}" unless clauses.is_a? Hash embed = clauses.delete(:embed) arguments = { params: clauses } arguments.merge!(embed: embed) if clauses.has_key?(:embed) find(:all, arguments) end end end require 'journey/resource/api' require 'journey/resource/attachments' require 'journey/resource/attribute_loading' require 'journey/resource/count' require 'journey/resource/embed' require 'journey/resource/enums' require 'journey/resource/enum_sets' require 'journey/resource/queries' require 'journey/resource/search' class Journey::Resource include API include Attachments include AttributeLoading include Count include Embed include Enums include EnumSets include Queries include Search end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
embark-journey-0.0.23 | lib/journey/resource.rb |