Sha256: e270156f52cc514fc7365070ea74eefd89b1249e42266080e7980a8dfa7e9ec8
Contents?: true
Size: 569 Bytes
Versions: 27
Compression:
Stored size: 569 Bytes
Contents
ImpressionistController::InstanceMethods.send(:define_method, :direct_create_statement) do |query_params={}| # creates a statment hash that contains default values for creating an impression. # if :impressionable_id is a valid ObjectId then convert it into one base = (defined? Moped) ? Moped::BSON : BSON query_params.reverse_merge!( :impressionable_type => controller_path.singularize.camelize, :impressionable_id=> !base::ObjectId.legal?(params[:id]) ? params[:id] : base::ObjectId.from_string(params[:id]) ) associative_create_statement(query_params) end
Version data entries
27 entries across 27 versions & 3 rubygems